MyBestRatedWebHosting's MBRW Second Semi-Annual 2011 Hosting Award has been officially announced! Save yourself time and money by reading our detailed review and learn who received the final award of the industry's best web host!

MyBestRatedWebhosting.com

Blocking IP Addresses with IP Deny Manager and .htaccess

Blocking IP Addresses with IP Deny Manager and .htaccess

The Apache web server is designed to support a variety of configuration tools that help you manage your site. One of them is the .htaccess file and the other is the IP Deny Manager, a feature integrated into the cPanel control panel. Both are quite similar and can be very useful when it comes to keeping bothersome visitors away from your site. This tutorial will guide you through the process of using the IP Deny Manager within cPanel and how to easily block IP addresses with the .htaccess file.

Working with the IP Deny Manager

– After logging into your cPanel account, click on the “IP Deny Manager” icon under the “Security” categories.

On the next page, you will have the option of launching a video tutorial that shows you how to use the IP Deny Manager. As we are covering that here, let’s move onto the next step.

Underneath the text “Add an IP to Deny”, enter a specific IP address or domain in the field that reads: “IP Address or Domain”. You can specify an IP address to deny by the following criteria:

  • Single IP Address
  • Range
  • Implied Range
  • CIDR Format
  • Implies

– After entering the required information, click on the “Add” button.

The IP Deny Manager is now activated and will prevent visitors from that particular IP address or domain from visiting your site. The only way they access your site is if you remove their name from the IP Deny Manager.

Creating an .htaccess File

Because many web hosting providers do not offer the .htaccess file through cPanel, you may have to create your own. There are two ways to create an .htaccess file. You can use a standard text editor like NotePad or the File Manager integrated into cPanel. Let’s work with the File Manager.

– From the main page of cPanel, locate and click on the “File Manager” icon under the “Files” category. This area contains all the files associated with your hosting account.

– Click on the folder icon beside your “public_html” directory.

You should now be able to view all the website files located in the public_html folder. Navigate the page, locate and click “Create a New File”. After doing so, you will see an empty text box. In the empty field, type in “.htaccess” and click the “Create button”.

The .htaccess file is now inside of your public_html folder. This file can be modified at any time to provide added security.

Blocking with .htaccess

Using .htaccess to block an IP address is easy. Simply add the following lines to your .htaccess file:

order allow,deny
allow from all
deny from (a particular IP address)
deny from (a particular IP range)

The IP Deny Manager and .htacess files both make viable options for preventing access from certain users. Both have the ability to block by IP address or domain while .htaccess offers added capabilities such as helping you enable password protection. Because .htaccecss is such a sensitive file, some web hosts forbid its usage. Therefore, it is always best to check with your provider before creating an .htaccess file on the server.

Related Articles

  • Top 5 cPanel Hosts
  • All MBRW cPanel Tutorials
  • Be Sociable, Share!
    « »

    2 Responses to “Blocking IP Addresses with IP Deny Manager and .htaccess”

    1. Sarage says:

      I have been a webmaster for almost a year now but I never really that this could be done. I am having a lot of trouble with spam but I couldn’t’ do a thing about it. Now, that I have read this article I would know how to deal with those spammers.

      Report This

      Was this review helpful to you? : Thumb up 0 Thumb down 0

    2. classifieds says:

      is there a way to block multiple ips from accessing just a single page on your site? and allowing them to access everything else? thanks!!

      Report This

      Was this review helpful to you? : Thumb up 0 Thumb down 0

    Submit your Review