allowing index access only with .htaccess
Posted
by Oliver Nourish
on Server Fault
See other posts from Server Fault
or by Oliver Nourish
Published on 2010-05-10T15:23:33Z
Indexed on
2010/05/10
15:34 UTC
Read the original article
Hit count: 347
.htaccess
Hello
I have this in my .htaccess file, in the site root:
Options -Indexes
<directory ../.*>
Deny from all
</directory>
<Files .htaccess>
order allow,deny
deny from all
</Files>
<Files index.php>
Order allow,deny
allow from all
</Files>
What I'm trying to achieve is to block folder and file access to anything that isn't called index.php, regardless of which directory is accessed. I have the folder part working perfectly and the deny from all rule is working as well - but my attempt to allow access to index.php is failing.
Basically could someone tell me how to get it working?
© Server Fault or respective owner