tags:

views:

29

answers:

2

how to make only certain ip can access my website..currently i'm using wordpress..if the ip are not in the list..the page will redirect to other site,,plizzz help me..

A: 

If you're on an Apache server (and AllowOverride is enabled) you could do this by making a file called .htaccess in the directory you want to restrict access to and enter:

Order deny,allow
Deny from all
Allow from 1.2.3.4 # replace this with your IP

Alternatively you could do this in your main Apache configuration, with a <Directory> directive but you won't be able to do this if you're on shared hosting. (Bit of a mini-assumption there, hence the .htaccess solution)

There are also other methods, for example editing your PHP to check the $_SERVER['REMOTE_ADDR'] value and die accordingly.

chigley
A: 

If you're really bored and have root, you could always try writing the appropriate rules in iptables.

waffle paradox