views:

399

answers:

3

Hi

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

+5  A: 

You want

Deny from all
Rob
+2  A: 

Maybe it's better to change the rights and ownerships of the folder instead of using .htaccess to do it.

Deny from All

is the way to do it in .htaccess

blub
If you change the rights and ownership, PHP (run by Apache) will not have access to the files inside that directory ; And I bet the OP still want to be able to access those with PHP -- he probably just doesn't want anyone to download the files directly.
Pascal MARTIN
+3  A: 

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]
Question Mark