Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I change the default ReadmeName for Apache directory indexes?

I have a readme file in the root of my site which I want to display as the readme file for Apache directory indexes unless the directory has it's own README.html file. Is this possible?

With the directory structure

-/README.html should display in it's directory index, should display, should display

I can set

ReadmeName README.html

in my config, but that will display "Apache Server at Port 80" in the footer of the directory index for
Likewise I can set

ReadmeName /README.html

but that will ignore the README.html in folder1/

Did any of that make sense? I'm not doing very well to explain this =)

share|improve this question
up vote 2 down vote accepted

I don't think you can do this globally. You can though specify a ReadmeName in the vhost/server context which points to a server wide file e.g.

<VirtualHost *80>
    ReadmeName    /README.html

This can be overridden per directory with a .htaccess file

ReadmeName README.html

From the Documentation

Both HeaderName and ReadmeName now treat Filename as a URI path relative to the one used to access the directory being indexed. If Filename begins with a slash, it will be taken to be relative to the DocumentRoot.

This works on an Ubuntu system I have to hand.

share|improve this answer
Unfortunately this won't work for what I'm trying to do. I'm setting up a software mirror server for a few projects, quite a few folders have README.html files in, but not all of them so I wanted to set a 'default' ReadmeName to show up in those. – Smudge Aug 2 '11 at 11:41
I just used different names in my example because I could. Set the server context to /README.html and the directory context to README.html that should do what you want. You still have to create the .htaccess files but that should be an easy script. – Iain Aug 2 '11 at 11:53
Yeah I got that, but there are a lot of subdirectories (I'd guess hundreds, maybe thousands) to check, and I have to RSYNC with the delete option so I'd have to re-create them every time. Yes it's possible but I was hoping for an easyer solution – Smudge Aug 2 '11 at 11:57
Also some of the directories have their own .htaccess files to set descriptions and non-standard ReadmeName's (I.E. for an entire directory and it's sub-directories) etc. so I'd have to check for that then append the ReadmeName on the end if needed. Not impossible but annoying – Smudge Aug 2 '11 at 11:59
I hope someone can show us both an easier solution. – Iain Aug 2 '11 at 11:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.