What I have now is the following:
RewriteRule ^([^/]+)/*$ x/$1.html [L,NC,END]
This would point:
/abcd to x/abcd.html
/ABCD to x/ABCD.html
which would not be fine on a Unix file system that is case-sensitive.
What I want is to point both variations to:
x/abcd.html
How can that be achieved?
Similar questions have been asked about this on Stack Overflow, but none seems to have addressed the issue of regexp back referencing on a Unix system.
Transforming the text in the URL, rather than just substituting it, can be achieved using the
RewriteMapdirective. The Apache httpd user guide has a page detailing how to use RewriteMap, which includes this example:The first line defines the map "lc" to be the built-in "tolower" function, and the second line applies that map to the back-reference $1 in a rewrite rule.
So in your example, you could use: