帝国CMS7.5在WIN下IIS7、IIS8、IIS8.5伪静态规则

来自:互联网
时间:2020-11-24
阅读:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<!--帝国7.5默认规则 IIS8的rule name不能重复相同-->
<rewrite>
<rules>
<rule name="listinfo">
<match url="^(.*/)*listinfo-(.+?)-(.+?).html\?*(.*)$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="{R:1}/e/action/ListInfo/index.php\?classid={R:2}&amp;page={R:3}" />
</rule>
<rule name="showinfo">
<match url="^(.*/)*showinfo-(.+?)-(.+?)-(.+?).html\?*(.*)$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="{R:1}/e/action/ShowInfo.php\?classid={R:2}&amp;id={R:3}&amp;page={R:4}" />
</rule>
<rule name="infotype">
<match url="^(.*/)*infotype-(.+?)-(.+?).html\?*(.*)$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="{R:1}/e/action/InfoType/index.php\?ttid={R:2}&amp;page={R:3}" />
</rule>
<rule name="tags">
<match url="^(.*/)*tags-(.+?)-(.+?).html\?*(.*)$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="{R:1}/e/tags/index.php\?tagname={R:2}&amp;page={R:3}" />
</rule>
<rule name="comment">
<match url="^(.*/)*comment-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)-(.+?).html\?*(.*)$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="{R:1}/e/pl/index.php\?doaction={R:2}&amp;={R:3}&amp;={R:4}&amp;page={R:5}&amp;myorder={R:6}&amp;tempid={R:7}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>


如果出现500错误,按下面的设置。或者取消动态压缩。
----------------------------------------------------------------------------------------------------------------------------------------------------------

我刚刚遇到这个问题,我发现这个解决方案很有帮助:https://www.saotn.org/iis-outbound-rules-with-gzip-compression/

基本上,在入站请求中,HTTP_ACCEPT_ENCODING标头被存储到临时标头中,然后在出站重写规则上恢复 .

在链接失效的情况下,这是以下步骤:

通过左窗格中服务器节点上的IIS管理器GUI,导航到URL重写

单击右窗格中的“查看服务器变量”

添加两个允许的服务器变量:

HTTP_ACCEPT_ENCODING
HTTP_X_ORIGINAL_ACCEPT_ENCODING

返回URL重写服务器的选项,单击右窗格中的查看前提条件 . 添加一个新的前置条件(我将其命名为NeedsRestoringAcceptEncoding)

将条件输入设置为,将模式设置为".+"(无引号) .
返回顶部
顶部