Cape.Computing Cape.Computing


You Are Here: Home : cape.computing : Developers' Info
Company Information


Electronic Commerce Services



Technical Support And References
Getting On-Line
On-Line Support
Dial-Up Number Finder
Spam Questions
Tech Support Links
Developers' Info
FAQs



People And Places Connected By Cape.Com



Explore Cape.Cod, New England and the World



E-Tools
Online Accounting
Webmail
Domain Registration
Search Our Site
Contact Cape.Com
Sign Up Now!




*

Return To Home Page


Preventing Directory Listings with htaccess

Glossary Items:

When a URL specifying only a directory is requested, for example http://www.somedomain.com/directoryname/, the web server looks for the following file names , index.html, index.htm, home.html, or, home.htm. If it finds a file by this name, it will serve the file, otherwise it will display a directory listing showing all the files in the directory. This behavior can be changed with the .htaccess "IndexIgnore" directive.

To prevent files from being listed, create a .htaccess file with the following directive within the directory that you want to protect:

IndexIgnore *

The * symbol is a "wild-card" that matches all files. Specific files can also be ignored. For example, to ignore files with .jpg extension (*.jpg), create a .htaccess file with the following directive:

IndexIgnore *.jpg

The .htaccess file affects the directory in which it is placed, and, directories recursively below it.


The information presented in this section is deemed accurate but is not guaranteed. It is provided as a free service to our subscribers and clients. Additionally, Cape.Com, Inc. exercises no editorial control over any links that are outside the www.cape.com domain and the content of these sites does not necessarily represent the views and opinions of our Company, its employees or clients.

You Are Here: Home : cape.computing : Developers' Info
509 Falmouth Rd, Mashpee, MA 02649 - 508-539-9500 - © Cape.Com Inc. All rights reserved.