IIS7本来是可以导入APACHE的伪静态规则的,但是后台产生的规则我用IIS导入没法正常使用,于是去网上找了一份规则,用是可以用了,但是还是存在两个问题:
1.首页门户文章没法正常显示,都是404错误
2.翻页有问题,比如一个帖子有3页,你要点两次第二页,他才会翻到第二页。
第一个问题昨天晚上我就发现了,用这句
第二个问题是昨晚冕阿姨说了我才发现,当时搞鼓了一下,没结果,今天早上起来对比DZ的规则看了一下,发现了问题的所在。用这一句
替换对应的那一句就可以解决。
完整的规则如下:
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name=”Imported Rule 1″>
<match url=”^topic-(.+)\.html$” ignoreCase=”false” />
<conditions logicalGrouping=”MatchAll”>
<add input=”{QUERY_STRING}” pattern=”^(.*)$” ignoreCase=”false”
/>
</conditions>
<action type=”Rewrite”
url=”portal.php?mod=topic&topic={R:1}&{C:1}”
appendQueryString=”false” />
</rule>
<rule name=”Imported Rule 2″>
<match
url=”^article-([0-9]+)-([0-9]+)\.html$” ignoreCase=”false” />
<conditions logicalGrouping=”MatchAll”>
<add input=”{QUERY_STRING}” pattern=”^(.*)$” ignoreCase=”false” />
</conditions>
<action
type=”Rewrite”
url=”portal.php?mod=view&aid={R:1}&page={R:2}&{C:1}”
appendQueryString=”false” />
</rule>
<rule name=”Imported Rule 3″>
<match
url=”^forum-(\w+)-([0-9]+)\.html$” ignoreCase=”false” />
<conditions logicalGrouping=”MatchAll”>
<add input=”{QUERY_STRING}” pattern=”^(.*)$” ignoreCase=”false” />
</conditions>
<action
type=”Rewrite”
url=”forum.php?mod=forumdisplay&fid={R:1}&page={R:2}&{C:1}”
appendQueryString=”false” />
</rule>
<rule name=”thread”>
<match
url=”^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$” />
<action type=”Rewrite”
url=”forum.php?mod=viewthread&tid={R:1}&extra=page={R:3}&page={R:2}”
/>
</rule>
<rule
name=”Imported Rule 5″>
<match
url=”^group-([0-9]+)-([0-9]+)\.html$” ignoreCase=”false” />
<conditions logicalGrouping=”MatchAll”>
<add input=”{QUERY_STRING}” pattern=”^(.*)$” ignoreCase=”false” />
</conditions>
<action
type=”Rewrite”
url=”forum.php?mod=group&fid={R:1}&page={R:2}&{C:1}”
appendQueryString=”false” />
</rule>
<rule name=”Imported Rule 6″>
<match
url=”^space-(username|uid)-(.+)\.html$” ignoreCase=”false” />
<conditions logicalGrouping=”MatchAll”>
<add input=”{QUERY_STRING}” pattern=”^(.*)$” ignoreCase=”false” />
</conditions>
<action
type=”Rewrite” url=”home.php?mod=space&{R:1}={R:2}&{C:1}”
appendQueryString=”false” />
</rule>
<rule name=”Imported Rule 7″>
<match
url=”^([a-z]+)-(.+)\.html$” ignoreCase=”false” />
<conditions logicalGrouping=”MatchAll”>
<add input=”{QUERY_STRING}” pattern=”^(.*)$” ignoreCase=”false” />
</conditions>
<action
type=”Rewrite” url=”{R:1}.php?rewrite={R:2}&{C:1}”
appendQueryString=”false” />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>