Last Updated: July 25, 2014

April 10, 2008

htaccess Blocking - cPanel Tutorial Ch.10

Apache web hosting servers have designed a number of configuration tools to assist the user in administrating their site.  Few of them have more purpose and functions than the little file by the name of .htaccess.  This file is powerfull when changes are made within it, giving users the freedom to override default functions of their web hosting server.

As a mere ASCII text file htaccess can be evolved to perform many operations.  We previously learned that this file can password protect the directories of your website.  It also has the ability to redirect users to a different location or block IP’s or certain domains.  

WHY BLOCK WITH .HTACCESS?

There is an endless amount of sites hosting blogs and member forums on the net.  These websites are frequently targeted by an equal amount of computer hackers and spammers.  Coming up with a solution to this never ending problem has been ongoing since the internet’s introduction. .Htaccess is great tool that limits this activity and gives you a bit more privacy.

You may have observed the fact there is no prefix for this file; it simply starts with a period and is then followed by the letters htaccess.  This means that it will typically be stored as a hidden system file.  Hidden system files can easily be unveiled via the manager page of your cPanel.  Since not all web hosting servers will allow the use of .htaccess, it is certainly best to check company regulations before proceeding.

HTACCESS vs THE CPANEL

While .htaccess files can be activated in via your cPanel there has been a debate on whether you should use them or not.  Being that .htaccess is such a sensitive file that could inadvertently shutdown a website it should only be used when absolutely required.  The IP Deny Manager feature of cPanel was one designed to work similar to .htaccess.   

Just like .htaccess the IP Deny Manager allows users to block IP addresses and domains from entering your website.  If there is an IP address or domain you wish to block from your website it can simply done within the cPanel:

- First log into the cPanel account
- Find the “site management” tab and click “IP Deny Manager”
- Locate “Add IP Deny” then type in the address you have chosen to block
- Click the “Add” button

From there your IP Deny Manager has been set.  The online hecklers you have singled out will never have access to your site again unless you choose to lift the ban.  Your htaccess file helps in the removal process, or you can simply select the IP from a drop down page in the IP Deny Manager and manually lift the ban.
One of the main reasons you may want to block an IP is due to the content of your site being stolen.  While the .htaccess file is a great way to prevent this activity, the cPanel also has a reliable feature that works on its own in the IP Deny Manager.


Tags: ip denyhtaccesscPanel Tutorialsapache 

Post comment:

Items marked by * are required

Find your hosting

Can’t decide what hosting is right for you? Read our Guide on how to pick a Web Hosting Provider.

Read the Buying Guide

Latest reviews

September 06, 2012

Christopher Kennedy

+ 4.6 4.6

Media Temple
Media Temple

Read full review

September 06, 2012

Mark Chappell

+ 4.3 4.3

Media Temple
Media Temple

Read full review

September 05, 2012

Kevin Hoctor

+ 4.9 4.9

Media Temple
Media Temple

Read full review

Advertising

Calendar