My directory:
/root/
/root/directory1/
/root/directory2/
If the .htaccess
file is located inside root,
How do I deny access to directory1
while allowing access to directory2
Could you please help by being precise? I am a total beginner, the office's pro is on vacation :) May thanks in advance!
Inside
/directory1/.htaccess
place this line:to block all access to
directory1
.The tl;dr version is below however it is better to learn how to fish. Thus rtfm so one knows what to do instead of always asking for the answer.
I suggest reading up on how to use .htaccess to block access to a resource and how to deny directory index. Also one needs to ensure that .htaccess files cannot be directly accessable with an absolute url.
Therefore your .htaccess should look something like the following: