Submit Your Article Forum Rules

Results 1 to 5 of 5

Thread: How do I block IP or country to visit my site?

  1. #1
    Junior Member
    Join Date
    Nov 2008
    Posts
    2

    How do I block IP or country to visit my site?

    Is there any way I could block an ip or whole region to view my site. ?
    I have been using this .htaccess method , but it doesnt work. I tried using my own ip.

    Is there any other method?

  2. #2
    Junior Member
    Join Date
    Dec 2008
    Posts
    9

    Re: How do I block IP or country to visit my site?

    Quote Originally Posted by taimurahmed View Post
    Is there any way I could block an ip or whole region to view my site. ?
    I have been using this .htaccess method , but it doesnt work. I tried using my own ip.

    Is there any other method?
    Have you tried this code ?
    Clockwatchers - .htaccess Tutorial - Block An IP Address

  3. #3
    Junior Member
    Join Date
    Dec 2008
    Posts
    15

    Re: How do I block IP or country to visit my site?

    Quote Originally Posted by taimurahmed View Post
    Is there any way I could block an ip or whole region to view my site. ?
    I have been using this .htaccess method , but it doesnt work. I tried using my own ip.

    Is there any other method?
    If you have an Apache server, you can do this without scripting. Scripting will still allow them to poke around your site. Additionally you'd have to do it on all files, and change it every time a new one comes up.

    This is a little complex, things can go wrong, so fully research before you drop in an .htaccess file with deny directives. Once you are familiar it, it as simple as creating a plain text file containing something like this, and naming it ".htaccess." "#" are comments and will not affect the functioning of the directives.

    order allow,deny
    <Limit GET POST>
    allow from all

    # specific ip address
    deny from 123.123.123.123
    # deny a range: 123.123.0.0 - 123.123.255.255
    deny from 123.123.0.0/16
    # the whole class: 123.0.0.0 - 123.255.255.255
    deny from 123.0.0.0/8
    # shorthand for previous
    deny from 123
    </Limit>

  4. #4
    Junior Member
    Join Date
    Jan 2009
    Posts
    9

    Re: How do I block IP or country to visit my site?

    Of course, the person in the blocked country and use a web proxy and still get to your site. Still, it would cut down on the less savvy folks.

  5. #5
    WebProWorld MVP kgun's Avatar
    Join Date
    May 2005
    Location
    Norway
    Posts
    7,999

    Re: How do I block IP or country to visit my site?


Similar Threads

  1. Visit my web site
    By marcomeneses in forum Submit Your Site For Review
    Replies: 1
    Last Post: 11-15-2006, 07:20 PM
  2. How to block a web site?
    By ee222 in forum Web Programming Discussion Forum
    Replies: 3
    Last Post: 09-21-2005, 08:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •