.htaccess help with contry blocking without my ip

Discussion in 'HTML & Website Design' started by ksgboy, Jan 24, 2012.

  1. #1
    Hi

    I'm using .htaccess to block some sites by country

    My question is how to block all my country without my ip

    My ip is 91.90.115.99


    My htaaccess looks like:

    ...........
    deny from 90.156.0.0/17
    deny from 91.90.56.0/21
    deny from 91.90.72.0/21
    deny from 91.90.88.0/21
    deny from 91.90.112.0/21
    deny from 91.90.160.0/20
    deny from 91.90.176.0/20
    allow from 91.90.115.99
    allow from all
    .............................

    But its not working

    CAn Anyone help me with that?
     
    ksgboy, Jan 24, 2012 IP
  2. WebCare||360

    WebCare||360 Member

    Messages:
    124
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    46
    #2
    Means, you want that only you would have access to your site? no one else?
     
    WebCare||360, Jan 25, 2012 IP
  3. ksgboy

    ksgboy Well-Known Member

    Messages:
    335
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    110
    #3
    yes correct

    Can anyone help?
     
    ksgboy, Jan 25, 2012 IP
  4. WebCare||360

    WebCare||360 Member

    Messages:
    124
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    46
    #4
    Try this:


    order deny,allow
    allow from 12.34.5.67
    allow from 98.76.54.32
    deny from all

    You can specify as many different allow from lines as you require. Or you can even allow entire IP subnet's by specifying just the first part of an IP, for example: "12.34.". This is called Htaccess IP Restriction.
     
    Last edited: Jan 25, 2012
    WebCare||360, Jan 25, 2012 IP
  5. ksgboy

    ksgboy Well-Known Member

    Messages:
    335
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    110
    #5
    so how this should look like?

    deny from 90.156.0.0/17
    deny from 91.90.56.0/21
    deny from 91.90.72.0/21
    deny from 91.90.88.0/21
    deny from 91.90.112.0/21
    deny from 91.90.160.0/20
    deny from 91.90.176.0/20
    allow from 91.90.115.99
    allow from all

    It looks like deny include my ip 91.90.115.99
     
    ksgboy, Jan 25, 2012 IP
  6. WebCare||360

    WebCare||360 Member

    Messages:
    124
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    46
    #6
    order deny,allow
    allow from 91.90.115.
    deny from all

    Try this :)
     
    WebCare||360, Jan 25, 2012 IP
  7. ksgboy

    ksgboy Well-Known Member

    Messages:
    335
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    110
    #7
    yes but now this block all users around the world but i want just block my country

    So can i make this

    order deny,allow
    allow from 91.90.115.99
    deny from 90.156.0.0/17
    deny from 91.90.56.0/21
    deny from 91.90.72.0/21
    deny from 91.90.88.0/21
    deny from 91.90.112.0/21
    deny from 91.90.160.0/20
    deny from 91.90.176.0/20
     
    ksgboy, Jan 25, 2012 IP
  8. WebCare||360

    WebCare||360 Member

    Messages:
    124
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    46
    #8
    Then you need to play with .htacess with the help of these sites:

    
    http://www.countryipblocks.net/
    http://ipinfodb.com/ip_country_block_htaccess.php
    
    Code (markup):
     
    WebCare||360, Jan 25, 2012 IP
  9. ksgboy

    ksgboy Well-Known Member

    Messages:
    335
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    110
    #9
    sending you pm
     
    ksgboy, Jan 25, 2012 IP