I have been trying to get Apache to rewrite all URL's that contain an uppercase character anywhere in it to be lowercase. All the solutions I have found do not work in my case for some reason. I am hoping someone here can help me track down why.
What I want is that if someone clicks a URL on our page that is like so http://example.com/products/productID/1234
they get sent to
http://example.com/products/productid/1234
instead. Notice the ID is lowercase. It will not always be just ID
either I want any upper case character converted to lowercase.
Basically any URL I visit does not get changed at all which leads me to believe that it is not even attempting to rewrite them. I have verified the rewrite_module
is un-commented as well.
I have tried the answers here: Convert and redirect URL in uppercase to lowercase using .htaccess
Excerpt of original httpd.conf
<VirtualHost *:80>
ServerName dev.xxxxxxx.com
DirectoryIndex default.cfm index.cfm index.htm index.html
DocumentRoot "Z:/XXXXX"
ServerAdmin technical@xxxxxxxxx.com
Redirect 301 /xxxxxxxxx/photoFiles https://www.xxxxxxxxx.com/xxxxxxxx/photoFiles
ProxyPreserveHost On
# ProxyPassMatch .*\.(jpg|png|gif|css|js|ico|htm|txt|csv|html|pdf|doc|docx|xls|xlsx)$ !
# ProxyPass / balancer://nodes/ stickysession=JSESSIONID|jsessionid scolonpathdelim=on
ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ ajp://dev.xxxxxxxx.com:7009/$1$2
# ErrorDocument 404 /errors/404.cfm
</VirtualHost>
Excert of updated (non-working) httpd.conf
<VirtualHost *:80>
ServerName dev.xxxxxxx.com
DirectoryIndex default.cfm index.cfm index.htm index.html
DocumentRoot "Z:/XXXXX"
ServerAdmin technical@xxxxxxxxx.com
RewriteEngine On
RewriteMap lc int:tolower
RewriteCond %{REQUEST_URI} [A-Z]
RewriteRule (.*) ${lc:$1} [R=301,L]
Redirect 301 /xxxxxxxxx/photoFiles https://www.xxxxxxxxx.com/xxxxxxxx/photoFiles
ProxyPreserveHost On
# ProxyPassMatch .*\.(jpg|png|gif|css|js|ico|htm|txt|csv|html|pdf|doc|docx|xls|xlsx)$ !
# ProxyPass / balancer://nodes/ stickysession=JSESSIONID|jsessionid scolonpathdelim=on
ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ ajp://dev.xxxxxxxx.com:7009/$1$2
# ErrorDocument 404 /errors/404.cfm
</VirtualHost>