httpd.ini伪静态规则直接使用iis7导入后的默认规则如下:
//将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>
- //将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>
//将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>
声明:本站发布的内容(图片、视频和文字)以原创、转载和分享网络内容为主,若涉及侵权请及时告知,将会在第一时间删除。本站原创内容未经允许不得转载:
西数超哥博客 »
httpd.ini伪静态规则转换为ii7规则后无法使用解决方法