Restrict access with .htaccess – Allow IPs range and blocks everything else

Here is some .htaccess example, if you want to allow access to the site only from certain IPs range and block all others:

Order Deny,Allow
Deny from all
Allow from 123.
Allow from 234.123.
Allow from 127.0.0.1

this .htaccess example will allow acces from IP-range:

  • 123.xxx.xxx.xxx,
  • 234.123.xxx.xxx
  • and 127.0.0.1.

and it blocks everything else!

byrev Written by:

Be First to Comment

Leave a Reply

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