.htaccess need to block traffic from one site

Discussion in 'Apache' started by SKULL, Dec 23, 2008.

  1. #1
    .htaccess i need to block traffic from one site , can anyone please tell me what i need to add in my .htaccess please.

    Thanks
     
    SKULL, Dec 23, 2008 IP
  2. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #2
    Not sure if it blocks the traffic from web site but you can try follow code in your .htaccess file:

    deny from site_ip_address

    Kailash
     
    kailash, Dec 23, 2008 IP
    SKULL likes this.
  3. SKULL

    SKULL Prominent Member

    Messages:
    5,301
    Likes Received:
    303
    Best Answers:
    0
    Trophy Points:
    350
    Digital Goods:
    1
    #3
    How will i go about getting a domain names ip?
     
    SKULL, Dec 23, 2008 IP
  4. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #4
    You will get the site ip from ping. Just ping to that domain in command prompt.

    ping websitename.com

    Also you can obtain A record from dnsstuff.com

    Kailash
     
    kailash, Dec 24, 2008 IP
  5. Tearabite

    Tearabite Prominent Member

    Messages:
    4,628
    Likes Received:
    429
    Best Answers:
    0
    Trophy Points:
    300
    #5
    it sounds to me like you want to block traffic REFERRED by a particular site? if so, something like this might help:

    RewriteCond %{HTTP_REFERER} nastysite\.com [NC]
    RewriteRule .* - [F]
    Code (markup):
     
    Tearabite, Dec 25, 2008 IP
    SKULL likes this.
  6. SKULL

    SKULL Prominent Member

    Messages:
    5,301
    Likes Received:
    303
    Best Answers:
    0
    Trophy Points:
    350
    Digital Goods:
    1
    #6
    Yep thats spot of , got it fixed now thou my host did it for me.
     
    SKULL, Dec 26, 2008 IP