We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
The Forum now has a brand new text editor, adding a bunch of handy features to use when creating posts. Read more in our how-to guide

Blocking an IP address

Wonder if anyone could help, I have a website and am trying to block an IP address the only problem being that the visitor is using a static address so I have decided the best way to stop this visitor would be to block all traffic. I have tried tweaking the htaccess file but don't seem to be having much luck.

Any ideas?
This is a the section of the htaccess file -
<Limit GET POST>
order deny,allow
deny from all
deny from client-86-29-
deny from client-86-29-141-193.cdif.adsl.tesco.net
deny from client-86-29-1xx-xxx.cdif.adsl.tesco.net
deny from cdif.adsl.tesco.net
allow from all
</Limit>

Comments

  • fwor
    fwor Posts: 6,941 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    Wonder if anyone could help, I have a website and am trying to block an IP address the only problem being that the visitor is using a static address so I have decided the best way to stop this visitor would be to block all traffic. I have tried tweaking the htaccess file but don't seem to be having much luck.

    Any ideas?

    I'm not by any means an expert, but isn't the syntax supposed to be:

    <Limit GET POST>
    order allow,deny
    allow from all
    deny from xxx.xxx.xxx.xxx
    </Limit>

    where xxx.xxx.xxx.xxx is obviously their static IP address, which you know from the server logs?
  • Ximian
    Ximian Posts: 711 Forumite
    Part of the Furniture 500 Posts Combo Breaker
    I'm guessing that your website is running Apache. Have you tried blocking the IP address for example 86.29.141.193 and see if that makes any difference? Also, why not edit the httpd.conf file and try the following:

    <Directory "/directory_name">
    Options FollowSymLinks Includes
    AllOverride None
    Order allow,deny
    Allow from all
    Deny from xx.xx.xxx.xxx
    Deny from xxx.xxx.xxx.0/8
    </Directory>

    You could also add the network in the deny field: Deny from xxx.xxx.0.0/16 but you'd need to know the subnet.
    You could also block the IP Address completely using firewall rules instead
  • fwor
    fwor Posts: 6,941 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    Ximian wrote: »
    You could also block the IP Address completely using firewall rules instead

    That's a good idea - using .htaccess to block traffic with Apache is reputed to be very inefficient. Doing the blocking in the firewall will probably minimise any additional load on the server.
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 353.5K Banking & Borrowing
  • 254.1K Reduce Debt & Boost Income
  • 455K Spending & Discounts
  • 246.6K Work, Benefits & Business
  • 602.9K Mortgages, Homes & Bills
  • 178K Life & Family
  • 260.5K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16K Discuss & Feedback
  • 37.7K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.