We have run into an issue where we have an existing Alias, and we would like to add a rewrite rule to catch all variations of case-insensitive spellings, ie:
URL: http://www.开发者_如何学Goexample.com/example
Alias /example "/var/www/html/web/example"
We need a rewrite rule to catch:
/ExamPle
/exampLE
/eXAmple
etc ...
We cannot seem to get the rewrite & Alias to work together.
In your main configuration:
RewriteRule ^/example(?:$|/)(.*) /example/$1 [NC,PT,R]
The magic is in the NC (no case) modifier. If you don't want a forward, you can omit the R modifier.
The PT (pass-through) modifier should make it play well with Alias
.
精彩评论