Hello,
I'm trying to redirect users from some countries from the registration page to a specific page using mod_geoip, but something is wrong because is not redirecting:
Code:
<IfModule mod_geoip.c>
RewriteEngine on
RewriteCond %{QUERY_STRING} ^app=core&module=global§ion=register$
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(A|B!C)$
RewriteRule ^(.*)$ http://www.domain.com/page/manual-registration.html [L]
</IfModule>
Can this be placed anywhere in vhosts or it need to be inside <Directory>?
Should I use FilesMatch instead (if it works ... I didn't test) or this does not work with query strings?
Code:
<FilesMatch "^index.php?app=core&module=global§ion=register$">
RewriteEngine on
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(A|B!C)$
RewriteRule ^(.*)$ http://www.domain.com/page/manual-registration.html [L]
</FilesMatch>
If you have better options I would like to know.
Thanks
Note: (A|B|C) are fake country codes, the GeoIP.dat is loaded and ON