I've Apache 2.2.13 running in console mode on Home windows. I've made an executable that handles demands. Inside a certain situation, if this picks up a URL pointing to some directory but hasn't trailing slash, it attempts to redirect towards the same URL using the missing slash appended. The exit-code is placed to 301. Oddly enough, getting this within the response header does not work:

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

but this may:

Location: something/

Shall We Be Held doing a problem? Or did I uncover a bug in Apache? (If that's the case, where and just how must i publish it best?)

Usually, 'Location' consists of a complete URL, including http: and also the hostname. This is actually the situation layed out by DVK.

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

This really is really another thing: an interior redirect. It's based on the CGI specification and works in certain other server conditions based on CGI, for example PHP. When Location consists of a 'virtual path', Apache delivers the page/script for the reason that path immediately, with no browser knowing there is any type of redirect.

Clearly that isn't what you would like because it will not make any sense to perform a 301 internal redirect once the browser won't ever see it's a 301.

Location: something/

This, however, is certainly not. It isn't a complete URL and it is not really a virtual path because it does not start with '/'. Apache does not understand what related to it, therefore it just guesses it is not an online path so spits it to the browser without any further comment.

It's invalid to transmit this inside a 'Location' header to some browser, quite a few them allows it anyway, and that's why it seems to operate. Really you ought to be passing the entire URL:

Location: http://www.example.com/cgi-bin/mycgi.exe/something/

1) Simply to be obvious, the redirection functionality (e.g. "how to proceed when seeing "Location: http response) is within your browser, not in Apache. I suppose you will know but desired to make certain it's obvious. The main reason it's relevant here's because as per the RFC, the address in 301 response must be "just one absolute URI". So that your URI example is missing your domain title, e.g. must be http://your.web.server/cgi-bin/mycgi.exe/something/

Although some web clients accept 301 with relative redirect, others don't.

2) Are you able to please specify precisely what you mean by "doesn't workInch including client's error and then any errors in Apache's log? Thanks

Also, please specify which from the following Web addresses work in the client and that do not:

Thanks