301 rewrite loop with a lowercase URL rule and a URL slug rule [on hold]
- by anyvendetta
I need to do a 301 rewrite to force all urls to become lowercase.
I put in .htaccess (RewriteMap lc int:tolower in httpd.conf):
RewriteCond %{REQUEST_URI} [A-Z]
RewriteRule . ${lc:{REQUEST_URI}} [R=301,L]
Everything works just fine except to urls with subcategories which in this case are:
/category-1256-Product-page-example.html
The numer 1256 refers to a “subcategory”.
So when i try to access /category-1256-Product-page-example.html gives me a loop error message.
I think another redirect rules are making the loop but dunno how to fix it because are just this urls rewrite rules that don't work with the above rewrite.
Rewriterule ^main-site-url/category-([0-9]*)-([-_a-zA-Z0-9]*)\.html$ /subcategories.php?idcategory_main=1&idcategory=$1&category=$2 [L]
Rewriterule ^main-site-url/([0-9]*)-([-_a-zA-Z0-9]*)-([0-9]*)\.html$ /file.php?idcategory_main=1&idsubcategory=$1&product=$2&idproduct=$3 [L]