Jump to content

.htaccess


asmith

Recommended Posts

i have a folder name "files" . i want to forbid the access to it  ,i mean if someone type in the address bar : 

 

www.domain/part1/files/

 

 

it gave him error .

as i read somewhere else on this forum , i made an .htaccess file , with no content but "Options -Indexes".

i put that in files folder, but when i type the address, it still shows me the content of the folder, what thing i'm doing wrong ?

Link to comment
https://forums.phpfreaks.com/topic/83974-htaccess/
Share on other sites

Options -Indexes will not show the file list if you access the folder. I.e. http://example.com/folder will give a 403 Forbidden error but files can still be access, i.e. http://example.com/folder/file.ext will show.

 

Deny From All will give a 403 Forbidden error on both file listings and files.

 

 

So, if you want to hide the file listing but allow users to access the files use the former, if you wish to deny ALL access to all files use the latter.

 

 

In order to use the former in a .htaccess file placed in the folder you wish the settings to have effect on AllowOverride Options must be set. For the latter AllowOverride Limit must be set. You can also set AllowOverride All which will enable all directives in .htaccess files.

 

You can also put it in your httpd.conf file, but in order for this to work only on the folder you wish you use enclose it with <Location /path/to/folder> (path is relative to document root) and </Location>.

Link to comment
https://forums.phpfreaks.com/topic/83974-htaccess/#findComment-430352
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.