我在IIS7中有以下规则:
<rule name="RewriteAll" stopProcessing="true">
<match url="^([^/]+)/?$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{URL}" negate="true" pattern="\.axd$" />
<add input="{URL}" negate="true" pattern="\.png$" />
<add input="{URL}" negate="true" pattern="\.gif$" />
<add input="{URL}" negate="true" pattern="\.jpg$" />
<add input="{URL}" negate="true" pattern="\.css$" />
<add input="{URL}" negate="true" pattern="\.js$" />
</conditions>
<action type="Rewrite" url="default.aspx?page={R:1}" />
</rule>它可以捕获urls,比如http://mysite.com/contact/
例如,我不知道如何使用规则来捕获http://mysite.com/并发送到home.aspx。有人能帮我解决匹配的正则表达式吗?
发布于 2011-04-05 21:45:29
我通过添加以下规则修复了它:
<rule name="Index Request" enabled="true" stopProcessing="true">
<match url="^$" />
<action type="Rewrite" url="index.aspx" logRewrittenUrl="true" />
</rule>发布于 2011-04-05 19:05:38
为什么不在您的DNS服务器上设置一个规范名称(CName)来自动将http://domain.com重定向到http://www.domain.com?
请参阅CName explanation on wikipedia
https://stackoverflow.com/questions/5550777
复制相似问题