Forum Moderators: phranque
The tolower statement would affect the entire URL string, wouldn't it?
While you cannot declare a map in per-directory context it is of course possible to use this map in per-directory context.
RewriteMap lowercase int:tolower
RewriteCond $1 [A-Z]
RewriteRule ^([^/]+)/(.*) http://www.example.com/${lowercase:$1}/$2 [R=301,L] casedoesntmatter
you should also provide a fully qualified url
i would suggest adding a condition to limit that RewriteRule from firing for lower case directory names.
I have access to the config files, will not be done in htaccess
RewriteMap lowercase int:tolower
RewriteCond $1 [A-Z]
RewriteRule ^/([^/]+)/(.*) http://www.example.com/${lowercase:$1}/$2 [R=301,L]