.htaccess - htaccess and GEOIP infinite loop -


itemprop = "text">

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

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -