Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 11-23-2009, 04:58 AM   #1
HyperActive Warrior
War Room Member
 
Join Date: Mar 2008
Posts: 159
Thanks: 23
Thanked 4 Times in 4 Posts
Default Direct web country traffic - how to.

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.
Shift is offline   Reply With Quote
Old 11-24-2009, 08:43 AM   #2
HyperActive Warrior
War Room Member
 
Join Date: Mar 2008
Posts: 159
Thanks: 23
Thanked 4 Times in 4 Posts
Default Re: Direct web country traffic - how to.

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.
Shift is offline   Reply With Quote
Old 11-24-2009, 10:27 AM   #3
Personal hygiene coach
 
mojojuju's Avatar
 
Join Date: Aug 2005
Location: Potemkin Village
Posts: 1,083
Thanks: 268
Thanked 377 Times in 254 Posts
Social Networking View Member's Twitter Profile 
Default Re: Direct web country traffic - how to.

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
mojojuju is online now   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk

Tags
country, direct, traffic, web

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 08:38 AM.