Score:0

Serve mixed case files case-insensitive on Linux Apache without mod_speling?

gb flag
  1. On my media subdomain (nice separation of concerns, also for rulesets)
  2. I have files which are in Mixed-Case-intentionally (for maximum semantics, also for downloads)
  3. which I want to serve case-insensitive (for maximum reliability, also when told media URL orally)

mod_speling with CheckSpelling on and CheckCaseOnly on (and CheckBasenameMatch off to be strict) would do the job perfectly for me! Only that many Shared Webhosting services have mod_speling de-activated .

Do you know an alternative way within Apache or Nginx or Litespeed ?

Attempts that failed

mod_rewrite with a RewriteMap to lowercase

mod_rewrite with [NC] flag

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule "(.*\.(jpg|gif|png|webp))$" "$1" [NC]
  • The NC flag for the RewriteRule seems to only apply to the matching in the search pattern, not the replacement pattern. That was my interpretation of the tests that I conducted.
  • An idea I had: Maybe there's a creative method to match case insensitive in the destination via RewriteCond, and if that matches then simply get that variable (which then has the string with the exact capitalization) into the replacement part of the RewriteRule. But I have now idea if that's possible at all and how.

Any hints appreciated!

  • If you know a concrete Shared Webhosting service that runs mod_speling, I'm interested in that too.
  • But please only as a comment or in a standalone answer, so that this Q&A overally stays on topic and abides to the forum rules.
porg avatar
gb flag
@MrWhite I'm pinging you with your excellent knowhow in that domain!
porg avatar
gb flag
Simply not possible without `mod_speling` ?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.