Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Better Directory Listing on Web Server?

Options
  • 23-02-2008 6:19pm
    #1
    Moderators, Motoring & Transport Moderators, Music Moderators Posts: 12,778 Mod ✭✭✭✭


    I often create a directory and put "Options +Indexes" in the .htaccess so all files are visible. The only thing that bugs me is how crap the interface is. It only shows the first ~20 characters of the filename and it just generally looks ugly.

    Is this just standard or is there a way to make it better?


Comments

  • Registered Users Posts: 2,919 ✭✭✭Bob the Builder


    It's standard I think, there's not really much of a way of improving it, or so experience tells me! There are applications available that you just put the index.php file into the directory and that presents the files to the user in a very nice, neat, customizable fashion. I'll have a look for the file I used and I'll post again later...

    ~Nev


  • Moderators, Motoring & Transport Moderators, Music Moderators Posts: 12,778 Mod ✭✭✭✭Zascar


    That sounds perfect, thanks!


  • Registered Users Posts: 2,919 ✭✭✭Bob the Builder


    Here it is!
    Demo: http://evoluted.net/stuff/

    Application Homepage.
    http://www.evoluted.net/community/code/directorylisting.php

    I always found it really handy. Hope it helps.
    At least it's better than the gammy white background apache server running on port 80 file view thing, and doesn't require htaccess, is easy to template.

    Regards,
    Nev


  • Registered Users Posts: 3,886 ✭✭✭cgarvey


    There are a few tweaks you can make to the default apache httpd directory listings. Check out the IndexOptions directive in the manual.


  • Registered Users Posts: 568 ✭✭✭phil


    As cgarvey said, if it's just the width name you want to configure, you can use the Apache directive
    IndexOptions NameWidth=50
    

    There are other IndexOptions parameters that control other variables. See here for more info http://httpd.apache.org/docs/2.0/mod/mod_autoindex.html#indexoptions

    The other alternative is to use a pre-packaged autoindex script ala http://autoindex.sourceforge.net/

    You can customise your own autoindex script by simply setting the last file in your DirectoryIndex to /dirindex.php or something similar. If you need this to be across multiple vhosts, then you can use the following directives outside any VirtualHost directives.
    Alias /dirindex /path/on/server/to/dirindex
    DirectoryIndex index.html otherindexpages.html /dirindex/dirindex.php
    

    Phil.


  • Advertisement
Advertisement