Like Schults, I know nothing! I would like to do some geo-targeting and have discovered that the country I am targeting has 167 blocks of ip addresses assigned to them. Some examples are : 58.69.0.0 to 58.69.255.255 58.71.0.0 to 58.71.127.255 61.14.192.0 to 61.14.255.255 The first line in the example goes the whole distance and I thought that I can write (okay, so I copied from another post in this Forum) the code as such: RewriteCond %{REMOTE_ADDR} ^58\.69\. RewriteRule ^index\.html$ http://www.philippines.sub.domain.net/ [R=301,L] Now here are my questions? 1) What is wrong with the above code? 2) How do I end an IP block that does not go the distance? Such as line two in the example above. 3) How do I do multiple blocks? If I were to guess I would do something like the following code correct? RewriteCond %{REMOTE_ADDR} ^58\.69\. RewriteCond %{REMOTE_ADDR} ^61\.14\.192\. RewriteRule ^index\.html$ philippines.page.html [R=301,L] Thanks, Jim
Personally I'd look at http://www.maxmind.com/app/mod_geoip However: RewriteCond %{REMOTE_ADDR} ^58\.69\. [OR] RewriteCond %{REMOTE_ADDR} ^61\.14\.192\. RewriteRule (.*) http://www.philippines.sub.domain.net/$1 [R=301,L] Code (markup): That sends the visitor to the same page but on the philippines subdomain.
the a.m. mod_geoip certainly is maintenance friendlier - you just update once a months the free geoip db else with the htaccess rewrite method you have to check every few days or weeks for new IP blocks assigned to the Philippines. make sure you include in your IP blocks all major mobile proiders in the PH such as smart, globe, pldt, etc besides traditional ISP IP blocks
I use the free geoIP db for my access_log stats and YES the major mobile ISP show up smart, globe, pldt for others i have no experience if you know of a local ISP IP or another mobile ISP, you may want to test http://www.maxmind.com/app/locate_demo_ip the free db is basically the same except only updated once a month and maybe less accurate (city/regional) data