On a website there is folder products/ and inside are php files with some Uppercase characters.
Example: www.example.com/products/BIT-Defendar.php
Now this urls exist for years and all around search engines. It was a mistake from the product manager.
But I want to fix this i want only lowercase URL's.
Will this fix my issue? CheckSpelling On
CheckCaseOnly On
(1)
And whats different with mentioned above and: (2)
RewriteMap tolowercase int:tolower
RewriteRule ^(.*)$ ${tolowercase:$1}
If I use (1) then all works wither I request url lower cased or upper-cased (but will I have search engine problems?)
If I use (2) I have to rename all files inside of products/ folder to lowercase.
---- EDIT ----
When i use RewriteRule
i get transferred to domain root if url is uppercase, if i use CheckSpelling
and CheckCaseOnly
then all fine.
I have tested with this and i get:
RewriteCond %{REQUEST_URI} [A-Z]
- This condition was met
RewriteRule (.*) ${tolowercase:$1} [R=301,L]
- This rule was met, the new url is http://www.example.com/${tolowercase:products/BIT-Defendar.php}
- Test are stopped, because of the R in your RewriteRule options. A redirect will be made with status code 301
My setup in httpd.conf
:
<VirtualHost *:80>
RewriteMap tolowercase int:tolower
</VirtualHost>