Block individual countries/languages from a page?

Discussion in 'HTML & Website Design' started by Xitanto, Aug 29, 2006.

  1. #1
    I've got a proxy:

    mediahug.com/proxy

    I want to experiment with banning Iranians from it. No, I'm not doing it without purpose - it's just that Google Adsense doesn't serve high-paying Farsi ads. So - is it possible for me to redirect either:

    Iranians
    Farsi-set computers

    from the above proxy, to my main page? I was thinking I could do it with PHP, but I don't know exactly how.
     
    Xitanto, Aug 29, 2006 IP
  2. wildcard

    wildcard Active Member

    Messages:
    58
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    98
    #2
    Hello,

    The most efficient and easy way is to block, or allow users from a certain country to visit your website is with the help of a so called .htaccess file on your server. In this .htaccess file you write which ip addresses should not have access and which ip addresses should have access.

    The website located on blockacountry.com gives a service where you can easily click on the countries you wish to block. Following blockacountry.com generates you a .htaccess document which you can upload to your server and there you go. As easy as 1,2,3.

    Wildcard
     
    wildcard, Jul 7, 2007 IP