Tip of the Trade: Directory Indexes in Apache
This little hack is so easy, that we have an almost have a missionary zeal to spread it to Apache Webmasters everywhere. In addition to its simplicity, it's a great convenience to visitors. How many download sites have you visited that display file indexes like this? Truncated filenames are so last century. Adding two simple lines to httpd.conf will expose filenames in their entirety and may well change your life.
Index of /pub/asterisk Icon Name Last modified Size Description [DIR] Parent Directory - [ ] ChangeLog-184.108.40.206 06-Jun-2006 11:37 93K [ ] ChangeLog-220.127.116.11-ne..> 06-Jun-2006 11:37 93K [ ] ChangeLog-addons-1.2.3 01-Jun-2006 17:50 3.4K [ ] INSTALL.README.X100P 04-Dec-2005 18:21 2.8K [ ] INSTALLX100P.ps 04-Dec-2005 18:21 309K [DIR] appnotes/ 04-Dec-2005 18:21 - [ ] asterisk-1.2-current..> 06-Jun-2006 11:37 10M [ ] asterisk-1.2-netsec-..> 06-Jun-2006 11:37 10M [ ] asterisk-18.104.22.168-net..> 06-Jun-2006 11:37 1.5K [TXT] asterisk-22.214.171.124-net..> 06-Jun-2006 11:37 378 [ ] asterisk-126.96.36.199-net..> 06-Jun-2006 11:37 75
To find your way to the present, expose the entire filenames by adding these lines to httpd.conf:
IndexOptions FancyIndexing VersionSort IndexOptions FancyIndexing VersionSort NameWidth=40
Index of /linux/fedora/linux/core/5/i386/os/Fedora/RPMS Icon Name Last modified Size Description [DIR] Parent Directory - [ ] ElectricFence-2.2.2-20.2.i386.rpm 06-Mar-2006 14:54 31K [ ] GConf-1.0.9-20.i386.rpm 06-Mar-2006 16:38 562K [ ] GFS-kernel-188.8.131.52-5.FC5.17.i686.rpm 14-Mar-2006 18:48 182K [ ] GFS-kernel-smp-184.108.40.206-5.FC5.17.i686.rpm 14-Mar-2006 18:48 184K [ ] GFS-kernel-xen0-220.127.116.11-5.FC5.17.i686.rpm 14-Mar-2006 18:48 188K
IT Solutions Builder TOP IT RESOURCES TO MOVE YOUR BUSINESS FORWARD
Which topic are you interested in?
What is your company size?
What is your job title?
What is your job function?
Searching our resource database to find your matches...