How do I lock a specific folder on my server using htaccess?


On my server I want to upload files and pages that only I can see.

I know that with the ...

order allow,deny
allow from (IP)
deny from all

I can block people, but I block all the server and that's what I want to avoid.

How do I do a deny from all but only for the folder where I will upload my pages? As long as índex.html continues to publish?

asked by Jose Fabio 웃 23.12.2016 в 03:51

1 answer


You just have to create a .htaccess file in the directory path that you want to deny, that is:


Which should have a simple:

Deny from all

That should be enough for what you want!

answered by 23.12.2016 / 04:11