Home :: Blog :: Articles :: Web-Hosting :: How to Block IP Address Using htaccess File

How to Block IP Address Using htaccess File

How to Block IP Address Using htaccess File
Category: Web-Hosting
Posted:
Views: 2189
Comments: 0 [Post]
Synopsis: You may come accross sometime that some illegal login or hacker is trying to access you main admin area or if you want to block black-listed IPs.

How to Block IP Address (single or Multiple) Using htaccess File

You may come accross sometime that some illegal login or hacker is trying to access you main admin area or if you want to block black-listed IPs.

To restrict certain IPs from accessing your site or directory, use the following code:

allow from all
deny from 123.11.22.110
deny from 123.12

You may use the full IP or a part of the IP.  Add the new IPs in new lines.
When blocked visitors try to access your site from the banned ip they get a 403 error access forbidden message.


Comments on How to Block IP Address Using htaccess File

Start the conversation by being the first to comment!

Share comments

Your Name: *
Comments: *
Please Note: HTML Markup will be automatically removed.
The ability to post urls has been disabled by the site administrator.
*
Type the characters you see in the picture:

*