Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 362189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:13:16+00:00 2026-05-12T13:13:16+00:00

I have Apache 2.2.13 running in console mode on Windows. I have made an

  • 0

I have Apache 2.2.13 running in console mode on Windows. I have made an executable that handles requests. In a certain case, when it detects a URL pointing to a directory but has not trailing slash, it tries to redirect to the same URL with the missing slash appended. The exit-code is set to 301. Strangely enough, having this in the response header doesn’t work:

Location: /cgi-bin/mycgi.exe/something/

but this does:

Location: something/

Am I doing something wrong? Or did I discover a bug in Apache? (If so, where and how should I post it best?)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T13:13:16+00:00Added an answer on May 12, 2026 at 1:13 pm

    Usually, ‘Location’ contains a full URL, including http: and the hostname. This is the case outlined by DVK.

    Location: /cgi-bin/mycgi.exe/something/

    This is actually something else: an internal redirect. It is defined by the CGI specification and works in some other server environments derived from CGI, such as PHP. When Location contains a ‘virtual path’, Apache serves up the page/script in that path straight away, without the browser knowing there was any kind of redirect.

    Obviously that’s not what you want as it makes no sense to do a 301 internal redirect when the browser will never see that it’s a 301.

    Location: something/

    This, on the other hand, is nothing. It’s not a full URL and it’s not a virtual path as it doesn’t begin with ‘/’. Apache doesn’t know what to do with it, so it just guesses that it isn’t a virtual path so spits it back to the browser with no further comment.

    It’s invalid to send this in a ‘Location’ header to a browser, but many of them will allow it anyway, which is why it appears to work. Really you should be passing the full URL:

    Location: http://www.example.com/cgi-bin/mycgi.exe/something/
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running Apache 2.2 in console mode on Windows to test an apache module
I have set up an Apache server running locally that hosts my web application
I have an Apache server running PHP-5.3.0 for Windows. For the creation of pdf
I have a Rails app that is running on a production server with Apache
I have my Apache http server running on localhost:80 and restlet server on localhost:8182,
I have Apache Tomcat Version 7.0.26 running. A have a JAX-RS servlet under /test,
I have two servers: Fedora running Apache/2.2.14 (old server) CentOs running Apache/2.2.3 (new server)
We currently have two EC2 servers running apache servers with django wsgi on freebsd.
Say I have a subdomain xxx.yyy.com running Apache. The files are stored in /home/someone/public_html/xxx
I am creating a small commercial web project running Apache/WSGI/Django/MySQL. I have a development

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.