Forum

No index at all without XSLT?

Marius Dinu
16 September 2015, 15:35
Hi.
I just finished compiling hiawatha without XSLT (it's for my router, not much memory there). It was an adventure convincing it to compile.

I am surprised that no directory index is available. I was expecting "ShowIndex = yes" to be available, a very simple index not based on XSLT. But no index at all?
XSLT is too much bloat for a router, but a simple dir index is a must-have.

Can you do something about this?

Thank you.
Hugo Leisink
16 September 2015, 21:50
Hiawatha uses XSLT to build directory listings. Withing XSLT support, no directory listings. I think that even a router is very capable of doing XSLT. But if you don't what to use that, the only option is to create directory listings yourself. Use the UrlToolkit below rule to redirect requests for directories to a CGI script which creates a directory listing.
UrlToolkit {
ToolkitID = show_index
RequestURI isdir Skip 1
Do Return
Match .* Rewrite /show_index.cgi
}
Marius Dinu
17 September 2015, 17:23
No URL toolkit.
So, which one uses less RAM when the server is idle? URL toolkit or XSLT?
Hugo Leisink
17 September 2015, 19:12
If UrlToolkits are also a no-go, then use the ErrorHandler:
VirtualHost {
...
ErrorHandler = 404:/show_index.cgi
}

The difference with the UrlToolkit rule is that show_index.cgi is now also called when a non-existing file is requested. The show_index.cgi script should be able to handle that.
Marius Dinu
18 September 2015, 21:41
I'm amazed by the flexibility of this little software!
Thank you!
Marius Dinu
19 September 2015, 23:57
I'm writing that cgi. What would be the proper way to check if the user asking for a dir index has the permission to view it?
Marius Dinu
20 September 2015, 01:16
Aaah, stupid question. Ignore it.
Hugo Leisink
21 September 2015, 19:33
Ok.
This topic has been closed.