Looking for a better way to setup a case insensitive URL redirect such that if user types
www.mysite.com/SPEEDmachine
it redirects them to
www.mysite.com/speed-machine-part-1/
I have the following brute force rules setup in .htaccess and these work fine:
RewriteEngine On
RedirectMatch /speedmachine http://www.mysite.com/speed-machine-part-1/
RedirectMatch /SpeedMachine http://www.mysite.com/speed-machine-part-1/
RedirectMatch /SPEEDMACHINE http://www.mysite.com/speed-machine-part-1/
However, the above rules fail for a different capitalization mix, such as: mysite.com/SpEEdMachinE
I tried the cPanel URL Redirect app, however it only handles the specific URL capitalization as I type it:
RewriteCond %{HTTP_HOST} ^mysite.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.mysite.com$
RewriteRule ^speedmachine\/?$ "http\:\/\/www\.mysite\.com\speed\-machine\-part\-1\/\/" [R=301,L]
I tried adding NC flag to the [R=301,L] options, for example
[R=301,L,NC]
but this has no affect and a mixed case URL doesn't redirect.
Appreciate your help.


