我一直在关注http://learn.iis.net/page.aspx/806/seo-rule-templates/,这是一个在IIS7中创建搜索引擎友好URL的几乎完美的指南。在IIS7中重写URL
我虽然一个问题:
如果我创建一个规则来重写www.domain.com/contact/
我在web.config中得到:
<rule name="RewriteUserFriendlyURL1" stopProcessing="true">
<match url="^([^/]+)/?$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="?p={R:1}" />
</rule>
但后来我做不到www.domain.com/contact/send/
。
如果我创建一个规则来重写www.domain.com/contact/send/
我得到在web.config中:
<rule name="RewriteUserFriendlyURL1" stopProcessing="true">
<match url="^([^/]+)/([^/]+)/?$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="?p={R:1}&a={R:2}" />
</rule>
但我不能这样做www.domain.com/contact/
两者的规则去做,让我看不到任何脚本,来自我的/scripts/
,/css/
和/images/
文件夹的css或og图像。
我该如何制定一条规则来匹配AND和NOT以匹配上面提到的3个文件夹?
没有人能回答我这个问题吗? :/ – Behrens 2012-01-12 10:14:21