[Dancer-users] Serving DirectoryIndex via Dancer fails

Mr. Puneet Kishor punk.kish at gmail.com
Thu Mar 17 14:49:01 CET 2011


My web site, [http://punkish.org] is Dancer powered (or, I should say, "proudly powered by Dancer"). However, from time to time, I create small, static, "micro-sites" under the same URI. For example, see [http://punkish.org/geoweb/index.html] or [http://punkish.org/opengov/index.html]. I serve these micro-sites from eponymous folders under /path/to/punkish/public/, so, for example, /path/to/punkish/geoweb and /path/to/punkish/opengov, etc.

My httpd.conf is set to serve DirectoryIndex index.html and index.cgi. Yet, if I go to [http://punkish.org/geoweb] or [http://punkish.org/opengov], Dancer thinks I am trying to query for a page called geoweb or opengov -- I was under the impression that it would first see if by adding a trailing slash to the requested URI, it could located static directory.

And, if I go to [http://punkish.org/geoweb/] or [http://punkish.org/opengov/], Dancer gives me a 404 error.

I *have* to specify that I am looking for index.html in order to serve the static files.

Is there a way to fix this? A fix, in my view, would be --

http://punkish.org/foo would be suffixed with a trailing slash and checked if a directory called foo exists. If it does, then the specified directory index would be served. If the directory doesn't exist, then Dancer would do its magic to determine how to serve the content request via foo.

I am using Apache2 with vhosts.

Puneet.


More information about the Dancer-users mailing list