Showing READMEs inline in dir listings?


#1

Sup all.

I’ve been doing a little shuffling about, and this is one of the things I’ve never been able to achieve on Apache: show README files inline in the directory listing (which some servers can do, particularly web sites which distribute Linux ISOs etc). It’s something I’ve tried for ages to achieve, and it’s something which LIGHTTPD can achieve with an included module:

http://trac.lighttpd.net/trac/wiki/Docs:ModDirlisting

I’ve never been able to find a satisfactory solution to achieve the same end, and I’ve been wondering if anybody on here knows a way to achieve the same result on DH?

Thanks all in advance
Christopher

dh ftw? yarly


#2

Both current DH Apache configurations (1.3.7 and 2.0x) include the mod_autoindex module which has this capability.

You can either use HeaderName or ReadmeName in an .htaccess file.

http://httpd.apache.org/docs/1.3/mod/mod_autoindex.html

Works like a charm to display a file inline before the index listing (HeaderName) or after the index listing (ReadmeName). Good Luck! :slight_smile:

–rlparker


#3

AHA! Sorry about my dumbness, my brain went totally blank regarding this subject - and what was annoying me the most earlier was that I could remember trying to get this to work on an old host a while ago, but I’d TOTALLY forgotten what Apache module it was which offers this functionality… And whatever I Googled for (and I usually regard myself as a proficient keyword Googler when it comes to finding what I want) I just couldn’t, for the life of me, remember what it was I should be looking for. Kept on coming up blank every time.

I’ll nip off and give this a go now, cheers for jogging my brain mate. :smiley:

[edited]
dh ftw? yarly
[/edited]

hahaha, who edited my post :wink: Here’s my own edit - for those who are seeking the resolve the problem of the file contents not showing up in the header, even if you specify them in the htaccess… The gotcha caveat in the Apache documentation (and it’s something I always forget):

So yeah, I named my file as .readme.htm and specified in the htaccess:

Options Indexes
HeaderName .readme

… and bam: it works great. :smiley:

(the . hides the actual file from the dir listing, thus increasing the magickness)

This is as much for my future reference (because I have a brain like a sieve), but I hope it comes in useful for others.


#4

Good deal, and I’m glad you got it working. Hopefully, your edits to your recent post will be useful to others with the same problems. Cheers! :slight_smile:

–rlparker