A way to divert just US traffic...?

7 replies
Hi All,

I've never done any type of scripting before, so I don't know if these is even possible, been searching on google and haven't found what I think I may be looking for.

I run some websites on a shared server.

I have some traffic from domain names I redirect to different websites on that shared server.

So is there a way for me to put some type of code on the index.html page of my website that just allows US traffic to enter the index.html page?

Thanks
#divert #traffic
  • Profile picture of the author Brandon Tanner
    Not a reliable way. You could use htaccess to allow US-only traffic based on IP ranges, but the problem is... new IP addresses are being added all the time, so you would have to constantly update your IP list so as to not leave any US traffic out. And that doesn't even take into consideration proxy traffic (people or bots who could be from any country in the world, and make it look like they are from the US).

    So the bottom line is... there's just not a very practical way to do what you want.
    Signature

    {{ DiscussionBoard.errors[8396857].message }}
  • Profile picture of the author topnichewebsites
    I was going to suggest what Brandon said as well but of course as stated will never be 100% but close to what you are looking for I believe.
    Signature
    http://pixelcovers.com/ <- eBook add eCovers

    https://www.unicommercesolutions.com <- WordPress Websites and Maintenance
    {{ DiscussionBoard.errors[8397114].message }}
  • Profile picture of the author prince55l
    The best way is to use maxmind geoip database to check user ip and redirect user to the page or site you want.
    {{ DiscussionBoard.errors[8401857].message }}
  • Profile picture of the author David V
    Ditto to Brandon. You'll also find an extensive answer in this WarriorForum thread from a couple months ago.
    {{ DiscussionBoard.errors[8401915].message }}
  • Profile picture of the author IdeaBox
    I can write a script that will get the IP's country and direct to whatever you want.
    {{ DiscussionBoard.errors[8401966].message }}
    • Profile picture of the author Beavis
      There's a few sites that maintain and allow download of a country-based IP address database (maxmind, ip2location). On the master page of the site I call a php function that checks if they are allowed. If so, I save a session variable so every other page they access does not require ANOTHER database query. If they are not allowed, they get a friendly message and no further.

      I use it on 3 of my US only sites to weed out foreign traffic. It has REALLY cut down on spam and makes the site more efficient by only servicing specific regions.
      {{ DiscussionBoard.errors[8409259].message }}

Trending Topics