Robot Portal

Easily manage all aspects of your account | Knowledgebase |

Knowledgebase

How to Block certain IP address?

Web servers can host many different domains on one hosting account under Linux/Apache, and public access to each domain and its folders and files can be controlled through the use of a .htaccess file to block a specific IP address, range of IP addresses, or multipleseparate IP addresses. The .htaccess file is typically found in the root folder of your domain (where you would also find the starting page for your web site) and is used for other purposes other than just controlling access to folders and files.

Installing a .htaccess file is not limited to the web site root folder, however. You can install the .htaccess file in any of your sub-folders and the server will apply the rules only to site visitors that attempt to access a file in that folder or any sub-folders below

Allow from All but Deny from a Specific IP Address(es)

The format of the instructions to place into the .htaccess file for blocking access to a protected area is as follows:

order deny,allow
deny from 99.999.999.991
deny from 99.999.999.992
deny from 99.999.999.993
allow from all

These instructions tell the web server to deny all requests to the web site protected area from IP addresses 99.999.999.991, 99.999.999.992, and 99.999.999.993, but allow requests from all other IP addresses.

Deny from All but Allow from a Specific IP Address(es)

You may also want to limit access to a folder only to a specific IP address or range of IP addresses. The format is the same but the contents of the .htaccess is slightly different.

order deny,allow
deny from all
allow from 99.999.999.991
allow from 99.999.999.992
allow from 99.999.999.993

In this case you are denying access from everyone but allowing access to only specific IP addresses or domain names.

  • 60 Users Found This Useful

Was this answer helpful?

Related Articles

500 Internal Server Error

Internal Server Error help, 500 error Internal server errors can be caused by a few different...

Do you provide AwStats?

Yes, we provide AWSTATS most of the servers of HostSEO Networks and it is updated automatically...

Register_Global ON?

Since register_globals is disabled on the servers for security purposes, some of your scripts and...

Unable to Access my site?

We receive lots of queries from our client saying that why i'm not being able to access my site....

How to change a php.ini value?

We use suPHP in all of our servers. So you can modify your php.ini value very easily! All you...

Born in 2004 ... Trusted By Clients n' Experts

SEO Stars

They never made me feel silly for asking questions. Help me understand how to attract more people and improve my search engine ranking.

Read More

Emily Schneller Manager at Sabre Inc
SEO Stars

Took advantage of Hostseo's superb tech support and I must say, it is a very perfect one. It is very fast, servers reliability is incredible.

Read More

Leena Mäkinen Creative producer
SEO Stars

We're operating a worldwide network of servers with high quality standards requirements, we’ve choose hostseo to be our perfect partner.

Read More

Ziff Davis CEO at Mashable
SEO Stars

It’s very comfortable to know I can rely about all technical issues on Hostseo and mostly that my website and emails are safe and secured here.

Read More

Isaac H. Entrepreneur
SEO Stars

With hostseo as a hosting partner we are more flexible and save money due to the better packages with great pricing, free SEO n' free SSL too!

Read More

Madeline E. Internet Professional