Do not give anyone access in the .htaccess directory

It is probably very simple, but I can not find it. I want to create a .htaccess file so that no one can get into the folder. except php on the server.

Does anyone know a line of code?

Thanks Matthy

+4
source share
4 answers

Do you want to

Deny from all 
+14
source

Instead of rejecting all traffic, you can try redirecting it with mod_rewrite to make it useful, that is, returning to the site stream.

 RewriteEngine on rewriteRule ^path/to/forbidden/directory/? index.php [L] 
+6
source

It might be better to change the rights and owners of the folder instead of using .htaccess for this.

 Deny from All 

is a way to do this in .htaccess

+3
source
 <Files *.*> order allow,deny deny from all </Files> 
+1
source

All Articles