开发者

Apache Rewrite and Alias combined

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜