I'm seeing a weird behaviour: when I print http headers to go for a local redirect without adding an HTTP Status that indicates a redirect, the redirect is done internally by apache.
Let's say I have a perl script named test.pl and a file test.htm which are accessable via /test.pl and /test.htm.
If test.pl contains #!/usr/bin/perl print "Status: 307\nLocation: /test.htm\n\n"; everything works as you'd guess, the browser gets a redirect, follows it and fetches test.htm
However If test.pl contains #!/usr/bin/perl print "Location: /test.htm\n\n"; The browser does _NOT_ get a redirect, but rather gets the response as if it had requested test.htm without any indication that an internal redirect happened.
There's nothing else going on, no mod_rewrite or anything. if you replace test.htm with another script and have them both edit a file, you'll see that both are executed.
Can anybody tell me which module / directive is responsible? It's not really a problem, I was just surprised when I didn't see a redirect reflected in the address bar when I looked through an old script.
You're missing the protocol and domain name on both code snippets, and therefore all bets are off...
Try including full URLs in that Location header, and see if that changes anything.
Also, be sure to delete your browser cache before testing any change to server-side code. Otherwise, your browser is going to show you cached pages and server response codes. Either delete the cache before each test of new code, or disable it entirely by setting it size or lifetime to zero (as appropriate to your browser). Don't forget to turn it back on when done, though!
jdMorgan: You're right, I forgot to mention: with absolute URLs the server returns the redirect to the client. It's only the local URI without a Redirect Status header. I've seen this on two servers, but I haven't really investigated myself, which I might have to if nobody knows the answer ;) I've watched it with Live HTTP Headers and even Wireshark since I thought it might be a bug in firefox, but it's not.
As I said, it's not a big deal, I was just curious "who" in the request cycle is responsible for it.