Answer the question
In order to leave comments, you need to log in
How to deny access to all .php except index.php?
And in all nested directories. Only index.php from root can be accessed.
htaccess now says this
<Files *.php>
Order Deny,Allow
Deny from all
# Allow from 127.0.0.1
</Files>
<FilesMatch "(?i)((\.php|\.tpl|\.html|\.exe|\.ini|\.log|(?<!robots)\.txt))">
Order Deny,Allow
Deny from all
</FilesMatch>
<Files ~ "(index|r)\.(ph?p)$">
Order Allow,Deny
Allow from all
</Files>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question