Article No. 193
Created: 04:33 AM 12.26.03
Author: HPU Support [Link: support@homepageuniverse.com]
Original URL: https://my.homepageuniverse.com/support/knowledgebase/question.php?qstId=193
Note: If you already have a .htaccess file you'd like to use, amend the following to the existing .htaccess file.
Open Notepad (or equivalent software depending on your OS) and paste in the following:
order allow,deny
deny from 127.0.0.1
allow from all
The above allows for you to deny a certain user at a single specified IP Address. To block multiple users, simply add more deny lines underneath the one that's already there. To block users from an IP range, the following can be used in place of the deny line above:
deny from 127.0.0.
Leaving off the last digit will block all users from 127.0.0.0 to 127.0.0.255. This is classified as an IP range. If you'd like to block a certain website, than the domain option might be the one you wish to use:
deny from somesite.com
This will allow for you to deny access to your site from this specific domain. To add multiple domains, simply add addition deny lines. However, if you'd like to deny access to a domain and all subdomains under that domain, try this:
deny from .somesite.com
This will deny access from somesite.com, as well as from anything.somesite.com
Save the file as htaccess (add . at the beginning and remove the .txt extension).
Upload the htaccess.txt file via FTP in ASCII mode and place in the httpdocs folder.
After uploaded right click the file (server copy) and choose rename
Edit the file name, so that it will be .htaccess (add a . to the beginning and drop the .txt extension)
The users you've blocked will now not be able to access your site. Enjoy!