.htaccess - htaccess and GEOIP infinite loop -
I wrote this in my htaccess:
GeoIPEnable RewriteCond% RewriteEngine on ON {ENV} : GEOIP_COUNTRY_CODE} PE RewriteCond% {HTTP_HOST} myweb.com [NC] RewriteCond% {HTTP_HOST}! Es [NC] RewriteCond% {REQUEST_URI}! ^ / Es / [nc] RewriteRule ^ (. *) $ / Es / $ 1 [R, L] SetOutputFilter DEFLATE AddOutputFilterByType DEFLATE Text / html Text / CSS Application / X-Javascript Rewrite% {REQUEST_FILENAME} -s [OR] Rev. % {REQUEST_FILENAME} -l [OR] revaccount% {REQUEST_FILENAME} -D recriminate rule ^. $ - [NC, L] Rev. Raul ^. * $ Index.php [NC, L]
I want to redirect to countries and other countries of Peru
But I got an error: I How can I fix this? Thank you.
Use negative lookahead regex to prevent redirects when it is already / es /
:.
GeoIPEnable RewriteCond% RewriteEngine turned on {REQUEST_URI} \ (? Jpeg | gif | bmp | png | tiff | css | js] $ [nc] RewriteCond% {REQUEST_URI} ^ / ( / | Index \ .php) [NC] RewriteCond% {ENV: GEOIP_COUNTRY_CODE}! PE RewriteCond% {HTTP_HOST} MyWeb \ .com $ [NC] RewriteCond% {HTTP_HOST} es [NC] RewriteRule ^ (. *) $ / Es / $ 1 [R, L]
Comments
Post a Comment