We encountered “File does not exist” problem after we changed the software name from “software_old.exe” to “software_new.exe”, then the http request for the file at “www.my_site.com/download/software_old.exe” always cause 404 error.
Is it possible to redirect the request for “www.my_site.com/download/software_old.exe” to “www.my_site.com/download/software_new.exe”? i.e. user type in address bar “www.my_site.com/download/software_old.exe”, he get “www.my_site.com/download/software_new.exe”
One of the reasons I went ahead and paid for The Definitive Guided to Apache mod_rewrite by Bowen is because he’s got a section all about when not to use it : )
mod_rewrite is a subset of regex made “easy” by “one line” variables that it can access. Where it gets “difficult” is in imagining what can be accomplished with it - better yet, what CAN’T be done with it! As you showed, Ralph, it can do what other tools can do, too, so it’s quite a POWERFUL (and useful) tool!
Great, thanks David. I’m really keen to learn something about this area, as it’s a big world of mystery to me at the moment. I’ve started to read your wonderful sticky thread, which provides a great introduction, I must say.
The reason for this is that mod_alias is a part of Apache’s core so it doesn’t need to be loaded nor does it have to go off and load the regex engine, too, i.e., it is much faster.
The first thing to learn about mod_rewrite is when NOT to use this POWERFUL tool.