Categories
.htaccess Tutorials & Tips

.htaccess: Restricting access to all *.php files except index.php

<Files *.php>
    Order Deny,Allow
    Deny from all
    #Allow from 127.0.0.1
</Files>

<Files index.php>
    Order Allow,Deny
    Allow from all
</Files>

The 2 <Files> directives must be in the exact same order as above.

By Yang Yang

Hello, I'm Yang. I build online businesses that please people. Want to join in and post some useful articles on Kavoir.com? Shoot me a message.