我对我的网站使用url重写。我在IIS上做了设置,它在服务器上工作。但它在本地主机上不起作用。这很正常,因为在我的项目文件中没有带重新编址的页面。我怎么解决这个问题?我在开发项目时使用cassini服务器。我应该在我的电脑中使用本地IIS吗?你可以在这里看到我的url重写web.config文件中的角色:Url重写在IIS上工作,但不在localhost中
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<rewrite>
<outboundRules>
<rule name="OutboundRewriteUserFriendlyURL1" preCondition="ResponseIsHtml1">
<match filterByTags="A, Form, Img" pattern="^(.*/)ProductDetail\.aspx\?prid=([^=&]+)&(?:amp;)?product=([^=&]+)$" />
<action type="Rewrite" value="{R:1}ProductDetail/{R:2}/{R:3}/" />
</rule>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
<rules>
<rule name="RewriteUserFriendlyURL1" stopProcessing="true">
<match url="^urun/([^/]+)/([^/]+)/?$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="ProductDetail.aspx?prid={R:1}&product={R:2}" />
</rule>
</rules>
</rewrite>
<urlCompression doDynamicCompression="false" />
</system.webServer>
相关:http://stackoverflow.com/q/2708187/1001985,http://stackoverflow.com/q/963545/1001985 – McGarnagle