Forum Moderators: phranque
http://www.example.com/FORUM
to
http://www.example.com/forum
http://www.example.com/FORUM gives me a 404 error and I need it to go to http://www.example.com/forum instead, need this code to work in my .htaccess file.
Few things I tried
RewriteMap lowercase int:tolower
redirectMatch 301 {lowercase:^(.*)$ http://www.example.com$1
the above does not work in htaccess files, anything I can do just for that one example?
Thanks!
Also, be aware that although you can use a rewritemap in .htaccess, you cannot define one there using RewriteMap; Maps must be defined in httpd.conf or one of the server-level config files. If you do not have access to the server config files, then you'll be stuck with an inefficient character-by-character replacement solution. If that is the case, be sure to put the code as close to the start of your .htaccess file as possible, because you will end up re-running the entire file for each uppercase character in the requested URL.
There are some threads around here that show how to replace the characters one at a time, deferring the external redirect until all are replaced. Try searching this forum for "uppercase lowercase rewriterule" and similar.
Jim
What you need depends on what you want, and we cannot tell you what you want.
I would suggest that you experiment a bit -- It's not likely that you will hurt anything if you place the code inside a "small" container at first, and then work up to more "global" containers, testing as you go.
We can "advise" and "help" here, but it's your server and your site(s) -- So it's up to you to do the real work -- and then test it until you're satisfied that it's perfect. :)
Jim