I'm trying to serve files case-insensitively from an Apache server that requires the use of mod_rewrite
to serve files from a subfolder.
.
├── .htaccess
├── example.com
│ └── downloads
│ └── file.zip
└── www.reddit.com
└── r
└── programming
└── index.html
The server acts as a proxy and serves each folder depending on the HTTP Host variable.
To do this, I use an .htaccess
to perform a simple internal redirect.
The problem arises because it also needs to be case insensitive, I want to serve file.zip
, FiLe.zip
, FILE.ZIP
etc..
For this I tried mod_speling
, which almost works. The problem is that if I access FiLe.zip
, I get redirected to http://example.com/example.com/downloads/file.zip
, which is a 404.
As I understand it, mod_speling
works in actual paths, so the result makes sense. However, it is not satisfactory.
Is there any way to rewrite the corrected path from mod_speling
?
If not, is there another possible way to accomplish this?
I also tried stacking a ciopfs
fuse mount, a case insensitive overlay file system, but it fails to see the files because it skips them if they contain any uppercase characters.
I cannot configure each of these subfolders as a different virtual host because there are hundreds of these folders and they are added or removed on the fly.