Sign in to follow this  
benryves

[web] .htaccess appears to be ignored

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this