Using .htaccess to ALLOW directory browsing



By default the apache install for most sites now restricts directory browsing. It’s a good idea, you don’t want just ANYTHING to be browsable on a web server, but there comes a time that it makes life easier for a directory (or tree of directories) to be browsable without having to write (copy and paste) links to a bunch of files. Fortunately, .htaccess files can be used for many things and this, of course, is one of them…


In my case, I was tired of linking to 5 rpm’s when posting a new version of rpms on the site, so… I found a suggestion that putting this:

Options +Indexes

in an .htaccess file in the folder I wanted to browse would work… strangely it didn’t. In my case, I found I had to do this…

Options +FollowSymLinks +Indexes

and things started working correctly. If you want a whole directory tree to be browsable the .htaccess file need only be put in the top directory of that tree and that browsable property will be “inherited” through all the subdirectories.

   Send article as PDF   

Similar Posts