Before everyone who can't hear a word against perl jumps all over queldor:
The mod_rewrite solution is significantly better, in that it just uses an
apache subrequest and returns the correct page to the initial request, where
the HTML redirect requires a full extra trip between the user agent and server.
(Though the cgi could do an Apache subrequest itself, at least in mod_perl 2
(not sure about mod_perl 1)). | [reply] |
Yeah, mod_perl original flavour can do that too. Works well, avoids breaking the user's back button or any of that gubbins.
| [reply] |
The thing is, if I'd spent three fruitless days trying to get it to work in perl, I'd understand if someone said "Why would you want to use perl for this when mod_rewrite is much more suited to the job?"
You see, I fully agree that your sample .htaccess should work. But it didn't. Three days is no exaggeration. I'm talking three full days of maybe 10 hours each where I literally did nothing but try different variations on the exact code in your example. There were probably a couple of dozen different ways that I could get it to work on my test server, but none of them worked on the live server. None!
Then after getting nowhere for 3 days, I wrote 8 lines of perl in about a minute and it worked the first time. I like that!
Hey, who knows, maybe given another 3 days, or maybe 6 or 60, I would've got mod_rewrite to work! But I'd rather be happy now than 60 days from now. : )
| [reply] |