IP Geolocation Redirect


Anyone knows any “free” GeoIP redirect via .htaccess file? For example if the user comes from China then the user gets redirected to Chinese Landing page and likewise for users from other countries


You can do something like this. Do not forget to backup your .htaccess file before making changes.

GeoIPEnable On
GeoIPDBFile /path/to/GeoIP.dat

# Start Redirecting countries

# Canada
RewriteEngine on
RewriteRule ^(.*)$ http://ca.abcd.com$1 [L]

Inside RewriteRule you can define your custom URL.