![]() |
|
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| PHP/HTML/CSS/JavaScript and Servers Pick up tips and exchange info on the technical side of having a web presence. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
If you find yourself with a nuisance user or bot that won't go away then this is the way to block them at server level.
If it doesn't already exist, you will need to create a file on your server called .htaccess. If you are using Windows you will need to create a file such as htaccess.txt, upload it to your server then rename it to .htaccess as Windows doesn't like this form of filename. Place one of the following examples in your .htaccess file with your own choice of IP(s)/domain(s). This method will block a single IP Code:
order allow,deny deny from 65.36.241.81 allow from all Code:
order allow,deny deny from 65.36.241 allow from all deny from 65.36 to block a greater range of addresses, though you should be very careful with blocking whole address ranges because you may end up blocking innocent users in the process. Also bear in mind that if it's a user you are trying to block that many people use dynamic IPs. This is the way to block a domain. Code:
order allow,deny deny from internetseer.com allow from all
__________________
Lawrence |
|
|||
|
Great tutorial Lawrence.
It may be worth pointing out that this may not work on a shared hosting environment through. Keep up the good work!
__________________
DesignandHosting.co.uk "affordable website design, hosting, email and ecommerce solutions"
Last edited by tuk485 : 04-07-2008 at 10:53 PM. |