Sign in to follow this  

[web] .htaccess appears to be ignored

This topic is 4584 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a single .htaccess file in my site:
IndexIgnore * <Files *> order allow,deny deny from all </Files>
This is inside the /public_html/uploads/ folder. All that is inside this folder is a bunch of subfolders (names based on an md5 hash of the uploader's IP address and the current UNIX timestamp), inside which is the file(s) that have just been uploaded. However, it is still possible to view a directory listing and view any of the uploaded files through the web browser. It is the only .htaccess file on the site... I feel I'm missing something obvious, but can't work out what it is. The installation of Apache 2 is straight out-of-the-box, with a couple of lines added to the configuration file to load the PHP module.

Share this post


Link to post
Share on other sites
Is the file actually readable by the apache process (e.g. world-readable)?

Share this post


Link to post
Share on other sites
Typical... you hunt around for an hour or so trying to get the bugger to work, post here, then find it in the next five minutes. [rolleyes]
The problem was this, inside httpd.conf:

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None


Set it to "All", restart the Apache server and now the .htaccess files appear to work as you'd expect.

Share this post


Link to post
Share on other sites
Well done. Such a complex .htaccess is unnecessary.


Deny From All


Is generally completely sufficient to deny access to a directory. It will prevent directory listings (if Indexes is enabled), and prevent any method of any access, to anyone.

Mark

Share this post


Link to post
Share on other sites
Sign in to follow this