2012-06-21 25 views
0

如何使用tuckey UrlRewrite小写每个字母的url?这是我现在的,但似乎没有工作。使用Tuckey的UrlRewriteRule

<rule match-type="regex"> <from>(.*)</from> <to type="redirect">${lower:$1}</to> </rule>

回答

2

你应该把检查大写字母的条件。 试试这个

<rule> 
    <name>Force URL's that contain upper case letter to lower case</name> 
    <condition type="request-uri" casesensitive="true">^.*[A-Z].*$</condition> 
    <from>^(.*)$</from> 
    <to type="permanent-redirect">${lower:$1}</to> 
</rule> 
相关问题