Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need to deny all IPs except mine from accessing site and display friendly error

I need to deny all IPs except mine.

I got my outward facing IP from whatismyip.com. Let's assume it is 200.200.200.200

Here is the beginning of my .htaccess

ErrorDocument 403 /down.html

<Limit GET POST>
order deny,allow
deny from all
allow from 200.200.200.200
</Limit>

This works with the denying part - it shows my down.html page. However it denies me even when I place my correct IP in the .htaccess. Am I doing something wrong?

Also the down.html page contains an image - but seeing as all requests are being denied, I had to host it on a different domain to get it to display. My .htaccess skills are a little rusty, but how would I go about allowing that one image request through using .htaccess on this domain?

like image 586
alex Avatar asked Dec 14 '09 01:12

alex


1 Answers

<Limit GET POST>
order allow,deny
allow from 200.200.200.200
deny from all
</Limit>
like image 163
miku Avatar answered Sep 20 '22 19:09

miku