Forum Moderators: phranque
I'm trying to do something that I thought was going to be simple... but no :)
I want to block all the access to my site, and only allow visitors to see index.html. The reason for this is that I have a service check for httpd and I would like a 200 back instead of a 403.
Here's what I've added:
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
# Allow from all <- Commented out, so the default "deny" will apply
# Allow access for everyone to index.html
<Files index.html>
Order allow,deny
Allow from all
</Files>
</Directory>
I've tried some variations, including <Files ~ "index.html">, <Files /var/www/html/index.html>, etc but with no luck. I understand that I can nest these directives and that <Files> should override <Directory>.
I've tried AllowOverride All, with no effect (I know, I was desperate!).
Maybe I'm overlooking something, any clues?
Thanks!
Pablo
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Order Deny,Allow
Deny from all
# Allow access for everyone to index.html in /html or in any subdirectory of /html
<Files index.html>
Allow from all
</Files>
</Directory>