allowing index access only with .htaccess
Posted
by YsoL8
on Stack Overflow
See other posts from Stack Overflow
or by YsoL8
Published on 2010-05-10T13:09:51Z
Indexed on
2010/05/10
13:14 UTC
Read the original article
Hit count: 353
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?
© Stack Overflow or respective owner