Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to block everyone but 1 IP address from my site on a server running apache & centos. My setup is follows the example below.

My server:


My .htaccess file

<limit GET> 
order deny,allow  
deny from all  
allow from

ErrorDocument 403
ErrorDocument 404

When I visit from an invalid IP, it gives me a generic 403 error. When I visit it redirects me correctly to but I can't figure out why the 403 error doesn't redirect me too. Anyone have any ideas?

share|improve this question

In some conditions, Apache doesn't like full URLs in ErrorDocument

Try redirecting to a local page that will redirect to google, and allow access to that page explicitly with:

ErrorDocument 403 google.html

<Files google.html>
 Order Allow, Deny
 Allow from all
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.