Protect your website from attacks, A htaccess trick

2009 was the black year of attacks.Thousands of sites were attacked .

Root cause of these attacks were either Script Vulnerability (for example < Joomla 1.5.7)

In this simple tutorial i am introducing you safer way to protect your website using htaccess file.

Follow these steps.

Step1.

Know your IP

Goto
http://www.whatismyip.com

and find your IP address

ie. we get our IP
Lets say

175.189.95.239
Step 2.

Protecting your admin directory

in most of the scripts you find your admin directory are

For Joomla:administrator
For WordPress:wp-admin
For Vbulletin:admincp
For most of E-commerce scripts it is :admin (for example Magento,Zen-cart,OS Commerce etc)

Please Locate your admin directory

Suppose we have our admin directory (Site backend ) as wp-admin

Now

Step3:

We are protecting our admin directory from attackers.

Now in

yoursite.com/wp-admin

find .htaccess and open it with text-editor

A.If you are sure your IP is static(call your ISP to confirm it)

add this code to your .htaccess


satisfy any
order deny,allow
deny from all
allow from 175.189.95.239
require valid-user

B.If your IP is not static (It is dynamic hence)

add this code to your .htaccess

satisfy any
order deny,allow
deny from all
allow from 175.189.
require valid-user

Going to prevent others to enter your site.
🙂

Leave a Reply

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