I would like to deny all ip addresses but allow one specific ip address in .htaccess. Can someone tell me how I should configure my .htaccess or is it a different file? I have CentOS 5 and Apache.

link|improve this question

0% accept rate
feedback

1 Answer

<Directory /directory_name>
    Order Deny,Allow
    Deny from all
    Allow from 1.2.3.4
</Directory>
link|improve this answer
2  
Small note: This won't work in an .htaccess file but only in the main Apache httpd configuration. If you want to use the snipper in an .htaccess file you'll have to drop the <Directory> tags. – joschi May 4 '11 at 19:45
feedback

Your Answer

 
or
required, but never shown

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