Httpd.conf for case-insensitive file serving

apache-2.2configuration

I'm a complete newbie with regard to managing Apache, so excuse me if I'm phrasing something incorrectly.

I have a web site — say, http://domain.com. The problem is that when I try to open http://domain.com/index.html in a web browser it displays the page, but when I attempt to access http://domain.com/Index.html (note capital I), it responds with HTTP 404.

How do I configure Apache to serve both these files (and directories, for that matter) in a case-insensitive manner? Current httpd.conf is here.

EDIT Dan C, thanks for a hint. I basically want to allow users to download files from my server and don't really want them to be aware that Index.html and index.html are in fact different.

I'm also very willing to know as to what are the ramifications of this decision.

Best Answer

The first thing that comes to mind is mod_rewrite, which is already loaded in your config.

Assuming your files are all in lower case (this may be a dangerous assumption):

RewriteEngine On

RewriteCond %{REQUEST_URI} [A-Z]
RewriteRule ^(.*)$ ${tolower:$1}