url="/ 替换为 url=" \. 替换为 . \? 替换为 ? \_ 替换为 _
//将http.ini规则直接在iis7下转换后的格式如下
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Òѵ¼ÈëµÄ¹æÔò 1" stopProcessing="true">
<match url="^(.*)/article-([0-9]+).html$" />
<action type="Rewrite" url="{R:1}/article\.asp\?id={R:2}" appendQueryString="false" />
</rule>
<rule name="Òѵ¼ÈëµÄ¹æÔò 2" stopProcessing="true">
<match url="^(.*)/show-([0-9]+).html$" />
<action type="Rewrite" url="{R:1}/show\.asp\?id={R:2}" appendQueryString="false" />
</rule>
<rule name="Òѵ¼ÈëµÄ¹æÔò 3" stopProcessing="true">
<match url="^(.*)/guestbook.html$" />
<action type="Rewrite" url="{R:1}/guestbook\.asp" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
//重新调整后正确可用的规则如下 //去掉了“(.*)”、去掉了“{R:1}”、将{R:2}改成{R:1}、将多余的斜杠去掉了
<rule name="Òѵ¼ÈëµÄ¹æÔò 1" stopProcessing="true">
<match url="^article-([0-9]+).html$" />
<action type="Rewrite" url="article.asp?id={R:1}" appendQueryString="false" />
</rule>
<rule name="Òѵ¼ÈëµÄ¹æÔò 2" stopProcessing="true">
<match url="^show-([0-9]+).html$" />
<action type="Rewrite" url="show.asp?id={R:1}" appendQueryString="false" />
</rule>
<rule name="Òѵ¼ÈëµÄ¹æÔò 3" stopProcessing="true">
<match url="^guestbook.html$" />
<action type="Rewrite" url="guestbook.asp" />
</rule>
亲爱的:若该文章解决了您的问题,可否收藏+评论+分享呢?
文章评论 本文章有个评论