I’ve been struggling with this for a while now. I couldn’t figure out how to set up my server with multivews, yet still allow enable autoindex to work, instead of returning an HTTP/1.1 403 Forbidden
error. I ended up finding out that I needed to extend the Options
directive with the Indexes
parameter. eg.
Options Multiviews Indexes
I’m now working on trying to get the directory indexes to be produced as valid XHTML, rather than invalid HTML 4.0 Transitional. Currently, the server is running Apache 1.3.26, so the IndexOptions XHTML
directive is not supported, since it is new to Apache 2.0.49. So I’ve sent of a request to my ISP to see if they will upgrade for me, but they may not.
What I would really like is a way to define the template file for the directory index, although I haven’t yet discovered how to do that, or even if it is possible. That way I could make it XHTML 1.0 Strict, and hopefully be able to configure the server to deliver the content as application/xhtml+xml
, rather than text/html
So, if anyone reading this (if I ever get any readers) knows a way to do this, or to improve any of my server settings, please post a comment or email me to let me know.
My suggestion:
Write your own directory indexing CGI and have it called when there is no index file, via the Directory Index directive. — Note that the Directory Index can be a list which includes local URL’s which need not be relative to the directory which is being indexed. I.e. as shown by an example in the documentation linked to below, you might set the URL /cgi-bin/index.pl as the last item in your directive so that if all other default files are missing the CGI will be called as a last resort.
http://httpd.apache.org/docs/mod/mod_dir.html#directoryindex
Of course, this is a lot of work. But it might be less work than your only other option (of which I am aware)… which is to rework the source code in your Apache distribution to output XHTML and then rebuild and reinstall it with your changes.
I almost did this once myself, as I also wanted to improve the autoindex output in some way. But I eventually decided not to put the effort into it, as I decided my time would be better spent learning the differences in 2.0 vs. 1.3 configurations and moving my server up to 2.0 finally. =)
Unfortunately that is not an option for me. My hosting company manages the server, and the only configurations I can make is using CGI scripts, PHP and .htaccess files. I will definately try your first suggestion though, but first I will have to learn PHP or Perl so I can do that. I’ve added it to my long list of things to do.
Thank you for your feedback.