Your Daily Source for Apache News and Information |
Breaking News | Preferences | Contribute | Triggers | Link Us | Search | About |
\n'); } if ( plugin ) { document.write(' '); } else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)) { document.write(''); } //--> |
|
|
internet.com Internet News Internet Investing Internet Technology Windows Internet Tech. Linux/Open Source Web Developer ECommerce/Marketing ISP Resources ASP Resources Wireless Internet Downloads Internet Resources Internet Lists International EarthWeb Career Resources Search internet.com Advertising Info Corporate Info |
By When a user requests a directory without specifying a particular file name, Apache attempts to serve up a default document. The document served is determined by the directive Directory listings are generated by the module If your directory does not have a There are a variety of default icons defined, so that different file types have different icons associated with them. And there's a link to the parent directory. It's actually pretty nice, but there are some annoying things about it. The directories are interspersed amoung the files, rather than appearing at the top like most of us are used to. There's a Some of the problems can be solved with the directives available in For the whole story ...For the full scoop on what you can do with Changing the IconsTo the left of each file name in a file listing, there's a little icon which presumably represents the type of file you're looking at. There's a pretty good selection of image files to choose from, but there are some file types missing, and occasionally you might want to have your own images, rather than the ones that ship with Apache. There are three directives with which you can rectify this situation. These are the
AddIcon (ALT,/url/of/image.gif) filename
AddIcon (Image,/icons/image3.gif) .gif .jpg .png AddIcon /images/tmp.jpg *~
AddIconByType (Image,/icons/image1.gif) image/* Finally, AddIconByEncoding /icons/compressed.gif x-compress IndexOptionsThe The syntax of the IndexOptions +option1 -option2 ... Options marked with + will be included in the set of options, and those marked with - will be ommitted. Note that if you forget the + or - in that list, the last item on the list is all that you get. That is, IndexOptions SuppressDescription ScanHTMLTitles is exactly the same directive as IndexOptions ScanHTMLTitles And, furthermore, it overrides all previous I'm not going to go over all of the available options - see the docs - but here are a few that I like. List Folders FirstThose of you that are used to a graphical representation of your directories -- something like the Windows file explorer, for example -- are used to seeing the directories at the top of the listing, and the files below that. The default Apache view is to have the directories listed in the same alphabetic ordering as the files. To override this behavior, use the IndexOptions +FancyIndexing +FoldersFirst Note that the Descriptions from HTML TitlesUsing the Describe your FilesAn exceptionally useful feature of AddDescription "My dog" /images/fido.jpg AddDescription "PNG images" *.png If you are in the habit of using really long file descriptions, or if you are using the IndexOptions +DescriptionWidth=42 Readme FilesOK, one more. It may be desirable to display some informative text at the top of a directory list. This may be information about the files in the directory, or it might be administrative information about the server. Or whatever. The ReadmeName README and you have a file in that directory called Another neat trick here is that you can use ConclusionIn the cases where you have directory listings rather than actual HTML pages, Thanks for your feedback on my articles, and thanks for reading. Please drop me a note at if you have questions, or suggestions of topics you'd like for me to cover in future columns. |
|
|
About Triggers | Media Kit | Security | Triggers | Login |
All times are recorded in UTC. Linux is a trademark of Linus Torvalds. Powered by Linux 2.4, Apache 1.3, and PHP 4 Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy. |