The apache webserver on a *nix platform is case-sensitive with URLs and the *nix file-system is case-sensitive already as well.
So what you try to do within the apache configuration is not supported out of the box.
If you only have some files, you could hardcode the rules into the .htaccess as well or start to create a rewrite-map:
RewriteRule ^about.php$ About.php [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]
You might be interested as well in extending your webserver with modules (e.g. like mod_spelling
) which can deal with file-name-differences between URL and on the disk.
The other alternative is that you inside index.php
check for the lowercase version of the file requested $_GET['q']
and if it exists, include
it and return
afterwards:
$basename = strtolower(basename(realpath($_GET['q'])));
if (is_file($path = __DIR__ . '/' . $basename)) {
include($path);
return;
}
The way of comparing against the actual file-system depends on your concrete needs and strategy of resolvement.