A .htaccess file may be employed to prevent the listing of the contents of directories without index documents -
Options -Indexes
To selectively block the listing of any README file and all .gif images, use the IndexIgnore directive -
IndexIgnore README *.gif
With this an “Access Denied” message will be shown to the visitors. To Show your visitor a custome error page you can use following lines in .htaccess
ErrorDocument 404 errors/notfound.html ErrorDocument 403 errors/forbidden.html ErrorDocument 500 errors/servererror.html
It is crucial to understand that the directives inside an .htaccess file apply not only to the directory in which the .htaccess file is placed, but also to its subdirectories.
Related Articles
Tags: Access denied, custom error pages, directory listing, Error Documents, htaccess, Not Found

February 28, 2008





Sorry, no comments yet.