Stuck on this one for a while before I turned for help, any assistance is appreciated.
For all intensive purposes I had to use this method to redirect all the lowercase URLS to work on my current setup, its not pretty I know.
The issue is when I use this setup all the Urls in the directory its supposed to skip break. For example /dont-touch/File1 stops working – I need to insert the below code so the lowercase rewrites dont apply to /dont-touch
RewriteCond %{REQUEST_URI} "/dont-touch/" [OR]
RewriteCond %{REQUEST_URI} "/blog/"
RewriteRule ![A-Z] - [S=26]
RewriteRule ^(.*)A(.*)$ /$1a$2 [R,L]
RewriteRule ^(.*)B(.*)$ /$1b$2 [R,L]
RewriteRule ^(.*)C(.*)$ /$1c$2 [R,L]
RewriteRule ^(.*)D(.*)$ /$1d$2 [R,L]
RewriteRule ^(.*)E(.*)$ /$1e$2 [R,L]
RewriteRule ^(.*)F(.*)$ /$1f$2 [R,L]
RewriteRule ^(.*)G(.*)$ /$1g$2 [R,L]
RewriteRule ^(.*)H(.*)$ /$1h$2 [R,L]
RewriteRule ^(.*)I(.*)$ /$1i$2 [R,L]
RewriteRule ^(.*)J(.*)$ /$1j$2 [R,L]
RewriteRule ^(.*)K(.*)$ /$1k$2 [R,L]
RewriteRule ^(.*)L(.*)$ /$1l$2 [R,L]
RewriteRule ^(.*)M(.*)$ /$1m$2 [R,L]
RewriteRule ^(.*)N(.*)$ /$1n$2 [R,L]
RewriteRule ^(.*)O(.*)$ /$1o$2 [R,L]
RewriteRule ^(.*)P(.*)$ /$1p$2 [R,L]
RewriteRule ^(.*)Q(.*)$ /$1q$2 [R,L]
RewriteRule ^(.*)R(.*)$ /$1r$2 [R,L]
RewriteRule ^(.*)S(.*)$ /$1s$2 [R,L]
RewriteRule ^(.*)T(.*)$ /$1t$2 [R,L]
RewriteRule ^(.*)U(.*)$ /$1u$2 [R,L]
RewriteRule ^(.*)V(.*)$ /$1v$2 [R,L]
RewriteRule ^(.*)W(.*)$ /$1w$2 [R,L]
RewriteRule ^(.*)X(.*)$ /$1x$2 [R,L]
RewriteRule ^(.*)Y(.*)$ /$1y$2 [R,L]
RewriteRule ^(.*)Z(.*)$ /$1z$2 [R,L]
This is how my HTACCESS file looks, Ive tried putting it at the start… the end. Nothing works.
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !/component/
RewriteCond %{REQUEST_URI} !/administrator/
RewriteCond %{HTTP_HOST} ^(www.)?example\.com$ [NC]
RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L]
First, you’re better of using RewriteMap here:
This will change everything in the URI to lowercase, instead of 26 slow rules.
Secondly, for the directories not to be rewritten, I don’t think you should put them in quotes
And if you put the
[L]flag at the end, nothing below that point will interfere with this rule.