If you have problems with certain visitors to your website, you can ban them by configuring an .htaccess file and placing it in the directory where you wish to restrict access to. There are two different ways to ban visitors: (1) using their IP address they came from or (2) using the domain name which they came from.
A. ENABLE .HTACCESS
- Login to the Netfirms Control Panel at https://controlpanel.netfirms.com
- Click Hosting
- Click Settings
- From the .htaccess section, use the pull-down menu option to choose enable
- Click Update
B. CONFIGURE YOUR .HTACCESS FILE
Example #1
The following examples deny a visitor coming from IP address 123.45.67.8 to your website:
order allow,deny
deny from 123.45.67.8
allow from all
Example #2
The following example denies visitors coming from a block of IP addresses coming from 123.45.67.0 to 123.45.67.255
order allow,deny
deny from 123.45.67.
allow from all
Example #3
The following example denies a user by the domain name from which they came from:
order allow,deny
deny from www.theirdomain.com
allow from all
Example #4
The following example denies a visitor from a domain name and all subdomains within the domain name:
order allow,deny
deny from .theirdomain.com
allow from all
Example #5
The following example denies all visitors except your own IP address assigned to you by your ISP (Internet Service Provider):
Order deny,allow
Deny from all
Allow from youripaddress
Example #6
The following example denies access to all files if the visitor is browsing from IP address 123.45.67.8:
<Files *>
Order allow,deny
Deny from 123.45.67.8
Satisfy All
</Files>
Note: Once your .htaccess file has been created you may upload it to the remote server via FTP. Please ensure that the .htaccess is uploaded in ASCII mode if your are using an FTP client such as filezilla or wsftp.
For further instructions on how to configure .htaccess, we recommend browsing to www.apache.org or httpd.apache.org/docs/misc/rewriteguide.html