Answer the question
In order to leave comments, you need to log in
How to deny access to php files in .htaccess?
Explain for .htaccess
How can I disable access to all php files, except for index.php, which is in the root?
This gives access to absolutely all indexes
<FilesMatch "\.php">
Order allow,deny
Deny from all
Satisfy all
</FilesMatch>
<FilesMatch "index\.php">
Allow from all
</FilesMatch>
RewriteRule \.php$ - [F]
Answer the question
In order to leave comments, you need to log in
deny from all
you create .htaccess in the directory
or you can disable everything in the main file, and then allow the necessary
<Files ~ "^.*">
Deny from all
</Files>
<Files ~ "^index\.php|css|js|.*\.png|.*\.jpg|.*\.gif">
Allow from all
</Files>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question