I have nginx setup, however I'm needing to fix an issue where someone types "/Home" to:
- rewrite it to the lowercase "/home" (do this to all files and directories, not just home) but locate the Uppercase (if there is one) file.
- Or do I need to add another location that uses the case-insensitive characters "~*" ?
The actual directory and file layout does contain mixed Upper and lower case characters. I would like to preserve this for simplicity sake, i.e. /Home and /About are the actual directories, but for SEO I want to permanent redirect to the lowercase /home but find the actual /Home directory.
I'm not sure if this can be accomplished by a rewrite rule or if there is a case insensitivity on the "location / { }" or some combination.
location / {
try_files $uri $uri/ /Home;
}
Note: I'm not looking for answers that fall into Nginx Pitfalls, including the evil Ifs.