Monday, February 05, 2007

Subdirectories of Website

What a lousy title. What I wanted to jot down here is how you can prevent your webpage from showing the subdirectories and the contents of the directories online. For example, if someone has a geocities account and the webpage is geocities.com/XYZ with two subdirectories A and B. If A and B are used mainly for storing files and not part of the links to your webpage, you can prevent the files in those directories from being shown by adding an index.html file in the subdirectories. In the index.html file, you can enter whatever you want, e.g. Forbidden / No authorization to view this page / Go away / Whatever. Therefore, whenever someone opens geocities.com/XYZ/A, instead of getting a list of files which you have kept in A directory, they will only be able to view the index.html page. Ta da! That is probably elementary but it took me a while to figure it out.

No comments: