RE: Useful Snippets for .htaccess 08-27-2013, 11:36 PM
#6
Nicely done. I have another useful tip to chime in.
You can restrict access to a particular folder according to IP address by adding:
Needless to say, you must have a static IP address in order for this to be effective.
As an example, Wordpress users might do this to prevent anybody but them from accessing the admin dashboard.
Similarly, you can also ban arbitrary IP's by using:
You can restrict access to a particular folder according to IP address by adding:
Code:
order deny,allow
allow from 10.0.1.2
deny from allNeedless to say, you must have a static IP address in order for this to be effective.
As an example, Wordpress users might do this to prevent anybody but them from accessing the admin dashboard.
Similarly, you can also ban arbitrary IP's by using:
Code:
<Limit GET POST>
order allow,deny
deny from 10.0.20.3
deny from 10.0.20.4
deny from 10.0.20.5
# etc...
allow from all
</Limit>

![[+]](https://sinister.li/images/modern/collapse_collapsed.png)