Disable access to a directory?

Status
Not open for further replies.

cursedpsp

New Member
Messages
237
Reaction score
0
Points
0
The "Password protect directory" in cPanel is useless because it pass protects it, and there isnt anything else there to block access to a directory.

How do i do this - even if i have to edit the .htaccess file.

I want the directory (/files) to be 403 FORBIDDEN if a user goes into the /files directory - but say an image (/files/image.gif) is still viewable. Like what they have on most websites.
 

cowctcat

New Member
Messages
401
Reaction score
0
Points
0
what you need to do is disable indexing for that directory.
go to the index manager in cpannel and click on the /files directory.
Select the no indexing option and then press save. that way people can not see what files are in the directory but can still access them.

Hope this helps
 

marshian

New Member
Messages
526
Reaction score
9
Points
0
If you want to disable indexing a directory called /dir, add this line to the .htaccess file this directory:
Code:
Options -Indexes
. This gives a 403 error if the user attempts to view /dir without having an index file there. (This also applies to any subdirectory).
If you really want to block all access to each file in a directory put this in the .htaccess:
Code:
<Files *>
order deny,allow
deny from all
</Files>
 
Last edited:
Status
Not open for further replies.
Top