iis6规则转换iis7

使用iis7 直接导入http.ini规则,生成规则web.config 和调整后对比

生成规则

<rule name=”已导入的规则 1″>
<match url=”^(.*)/index-2\.html$” ignoreCase=”false” />
<action type=”Rewrite” url=”{R:1}/2.php” />
</rule>

调整后规则

<rule name=”已导入的规则 1″>
<match url=”^index-2\.html$” ignoreCase=”false” />
<action type=”Rewrite” url=”2.php” />
</rule>

其中:match url (.*)/  去掉了

action type 对应去掉{R:1}/

生成规则

<rule name=”已导入的规则 4″>
<match url=”^(.*)/search-(.*)\.html$” ignoreCase=”false” />
<action type=”Rewrite” url=”{R:1}/search/index.php\?modelid\=all&amp;k\={R:2}” appendQueryString=”false” />
</rule>

调整后规则

<rule name=”已导入的规则 4″>
<match url=”^search-(.*)\.html$” ignoreCase=”false” />
<action type=”Rewrite” url=”search/index.php?modelid=all&amp;k={R:1}” appendQueryString=”false” />
</rule>

其中:match url (.*)/  去掉了  ,match url 中“\” 不变

action type 对应去掉{R:1}/

去掉action type 中的“\”转义 ,调整R:$ 对应条数

猜你喜欢

转载自blog.csdn.net/zhuzhu131654/article/details/82800311