Blocking users by IP – A Comprehensive guide to htaccess

Blocking users by IP - A Comprehensive guide to htaccess
Spread the love

Blocking users by IP. In my previous post, we have seen how to block a site file Prevent viewing of file with htaccess – A Comprehensive guide to htaccess

Here I will show you how to block or allow with IP.

order allow,deny
deny from 123.45.6.7
deny from 012.34.5.
allow from all

You can deny access based upon IP address or an IP block. The above blocks access to the site from 123.45.6.7, and from any subdomain under the IP block 012.34.5. (012.34.5.1, 012.34.5.2, 012.34.5.3, etc.) I have yet to find a useful application of this, maybe if there is a site scraping your content you can block them, who knows.


Spread the love

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *