Secure Your Site (.htaccess)

 Secure Your Site (.htaccess)

One way to prevent unwanted access of your site is using the file .htaccess

Reasons:
– Restrict access to a known hacker / bot from accessing your site
– Allowing only certain IP addresses to view your site (while in development, for example)
– Allow only trusted individuals in your site (if your users IPs remain the same, because it’s safer)
– Banning people from a particular country (or any location unknown) to access your site
– Ban people from your site


Here are lines that can be added to .htaccess:

Code:
<limit GET POST PUT>
order deny,allow
deny from 202.57.377.22
deny from 8.77.88.33
allow from all
</limit>

Remove access for specified IPs.

Code:
<limit GET POST PUT>
order deny,allow
deny from all
allow from 192.168.0.0/24
</limit>

Only allow access to the mentioned IP class.


[Image: xenno_24.gif]

Permanent link to this article: https://www.xenno.org/595/secure-your-site-htaccess/

Leave a Reply

Your email address will not be published.

CAPTCHA *

This site uses Akismet to reduce spam. Learn how your comment data is processed.