Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Give no one access in a directory .htaccess

It is probably very simple but I can't find it. I want to make a .htaccess file so no one can get into the folder. except for the php on the server.

does anyone know the code line?

Thanks Matthy

like image 558
matthy Avatar asked Nov 29 '22 05:11

matthy


2 Answers

You want

Deny from all
like image 190
Rob Avatar answered Dec 04 '22 10:12

Rob


Instead of denying all traffic you could try redirecting it with mod_rewrite to make it useful i.e. back into the flow of the site.

RewriteEngine on
rewriteRule ^path/to/forbidden/directory/? index.php [L]
like image 37
Question Mark Avatar answered Dec 04 '22 11:12

Question Mark