I need to redirect urls containing capital Cyrillic letters to lower Cyrillic letters as they generate 404 errors on the website.
I have tried this:
RewriteEngine On
RewriteCond %{REQUEST_URI} [A-ZА-Я]
RewriteRule ^(.*)$ /${tolower:$1} [R=301,L]
But it appears not to be working. I still get the 404 error. When I try to visit this:
I expect to be redirected to: https://mywebsite.com/продукт
but instead I get a 404 error. I am using litespeed webserver but as far as I know it uses the .htaccess file.
What could potentially solve this?
tolower
probably covers the English alphabet only. Might be easiest if you rewrite those requests to an actual script (PHP or something), that does the "lowering" of the characters, and then performs the redirect viaheader('Location: ...');
tolower
"rewrite map" is not even being called. @CBroe (Assuming you have defined atolower
rewrite map in the server config that calls the correspondingtolower
internal function?) If you are not getting a redirect then either the condition (RewriteCond
directive) is failing, OR if you've not defined the rewrite map then (on LiteSpeed) the entire rule is simply failing silently (an error should still be logged as the rewrite map is undefined) and nothing actually happens.