我想在URL重写模块的iis 7中为我的网站设置重写规则。如果网站名称是“WonderfulWidgets”IIS 7的URL重写 - 驼峰域和小写的一切
我希望它永远是http://WonderfulWidgets.com。
NOT:wonderfulwidgets.com
NOT:WONDERFULWIDGETS.com
我也希望以后WonderfulWidgets.com一切是小写。
IE WonderfulWidgets.com/best-widgets。
我已经完成了小写的URL重写,我也做它,所以它会前WonderfulWidgets.com删除任何领先的WWW
我的问题是我的小写URL重写也降低了域名。 我需要帮助编写CamelCase域名,并将其他所有内容重写为小写。
这是我在我的web.config:
<rewrite>
<rules>
<rule name="CanonicalHostNameRule1">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^WonderfulWidgets\.com$" negate="true" />
</conditions>
<action type="Redirect" url="http://WonderfulWidgets.com/{R:1}" />
</rule>
<rule name="RemoveTrailingSlashRule1" stopProcessing="true">
<match url="(.*)/$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Redirect" url="{R:1}" />
</rule>
<rule name="Default Document URL Rewrite" stopProcessing="true">
<match url="(.*?)/?Default\.aspx$" />
<action type="Redirect" url="{R:1}/" />
<conditions>
<add input="{URL}" pattern="WebResource.axd" negate="true" />
</conditions>
</rule>
</rules>
</rewrite>