![]() | | ||||||||
| | #1 |
| HyperActive Warrior War Room Member Join Date: Mar 2008
Posts: 159
Thanks: 23
Thanked 4 Times in 4 Posts
|
Hello. I want to direct all traffic from a specific country to an opt-in page. I read about a .htaccess file one can create to block an IP so maybe my answer lies in .htaccess? --- order allow,deny deny from 000.00.0.0 allow from all --- Someone else also mentioned this : Search the IP range that you want to redirect, than make an htacess file with the following syntax: RewriteCond %{REMOTE_ADDR} ^64\.126\.81\.30$ [OR] RewriteCond %{REMOTE_ADDR} ^75\.117\.244\.27$ RewriteRule .* http://www.mysite.com/europe.htm [R,L] (edit the ranges and the site/page and do not add the [OR] on the last line of IPs) --- Now I can go here and get all the IP addresses for a country (there's quite a few) IP Range - Ip Address Range Lookup - Ip Range Finder but I'm not sure how to implement this in an .htaccess file. Must I include this in the htaccess file - deny from xxx - and then list all the IPs that the url I just mentioned shows. Please help, thanks a lot. |
| | |
| | #2 |
| HyperActive Warrior War Room Member Join Date: Mar 2008
Posts: 159
Thanks: 23
Thanked 4 Times in 4 Posts
|
I don't mean to sound impatient but if anyone knows the exact solution for this please comment. I can go here and get all the IP addresses for a country (there's quite a few - 485) http://www.ipaddresslocation.org/ip_...get_ranges.php but I'm not sure how to implement this in an .htaccess file. It also lists them like this for example 41.0.0.0 41.31.255.255 (which I assume is a range). Must I list every IP that the ipaddresslocation I just mentioned shows? Or must it be in a different format like - <Files *> order deny,allow deny from 000.00.0.0 allow from all </Files> Thanks. |
| | |
| | #3 |
| Personal hygiene coach Join Date: Aug 2005 Location: Potemkin Village
Posts: 1,083
Thanks: 268
Thanked 377 Times in 254 Posts
|
Well, I think an easier way to go about doing this is to use the GeoIP tools from MaxMind. In particular, the mod_geoip for Apache. An introduction can be found here MaxMind - GeoIP Apache API |
| | |
![]() |
|
| Tags |
| country, direct, traffic, web |
| Thread Tools | |
| |
![]() |