Newsletter

KB Article

GP COM
How do I block access for a specific unwelcomed visitor on my website?

How do I block access for a specific unwelcomed visitor on my website?

Sometimes a single individual can cause a problem, an unwelcome visitor, on a website. This can be in the form of excessive downloading of material or simply because the individual posts nasty or offensive messages in a discussion forum.

If it is desired to block the individuals access to the site, a few lines must be added to a .htaccess file in the folder the blockade is desired on.

Order Deny,Allow
Allow from ALL
Deny from <IP-adresse>

If it is desired to block access from a single IP address, ex. 192.168.1.121, to access files in the folder, ex. /www/download, the following lines must be added to the file /www/download/.htaccess:

Order Deny,Allow
Allow from ALL
Deny from 192.168.1.121

Notice: A .htaccess file buts restrictions on the folder in which it is placed INCLUDING all subfolders. If it is desired to completely block out the individual from the entire website simply place the .htaccess file in the root of the 'www' folder.


Category: Limit access