IIS URL rewrite module url's to lowercase

邮差的信 提交于 2019-11-29 09:18:23

You could probably use something as follow:

<rule name="LowerCaseRule1" stopProcessing="true">
    <match url="[A-Z]" ignoreCase="false" />
    <action type="Redirect" url="{ToLower:{URL}}" />
    <conditions logicalGrouping="MatchAny">
        <add input="{REQUEST_FILENAME}" pattern="\.aspx$" />
        <add input="{REQUEST_FILENAME}" pattern="\." negate="true" />
    </conditions>
</rule>

The rule will be triggered only if one of the condition is true:

  • The first one checks if the requested path (filename) ends with .aspx.
  • The second one checks if the if the requested path (filename) doesn't contain a . (so doesn't have an extension)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!