Godaddy iis7 windows主机 Discuz7.X伪静态设置
来源:何草不黄blog 时间:2010-04-11 13:13:00
前些天安装完了Discuz7.2,由于是在win主机上安装的php程序,伪静态化,不能使用.htaccess这种方式,因此查了相关关文章,说iis7支持web.config的rewrite,因此试着使用web.config来实现,终于在Godaddy的win主机上实现了Discuz7.2的伪静态化.
这样更有利于被搜索引擎收录!
方法很简单,把下面的内容保存成web.config 并传到bbs目录下 ,并在后台启用静态化。
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 17">
<match url="^archiver/((fid|tid)-[\w\-]+\.html)$" ignoreCase="false" />
<action type="Rewrite" url="archiver/index.php?{R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 18">
<match url="^forum-([0-9]+)-([0-9]+)\.html$" ignoreCase="false" />
<action type="Rewrite" url="forumdisplay.php?fid={R:1}&page={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 19">
<match url="^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$" ignoreCase="false" />
<action type="Rewrite" url="viewthread.php?tid={R:1}&extra=page\%3D{R:3}&page={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 20">
<match url="^space-(username|uid)-(.+)\.html$" ignoreCase="false" />
<action type="Rewrite" url="space.php?{R:1}={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 21">
<match url="^tag-(.+)\.html$" ignoreCase="false" />
<action type="Rewrite" url="tag.php?name={R:1}" appendQueryString="false" />
</rule>
</rules>
</rewrite>
<httpErrors errorMode="Detailed" />
<asp scriptErrorSentToBrowser="true" />
</system.webServer>
<system.web>
<customErrors mode="Off" />
<globalization requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="utf-8" />
</system.web>
</configuration>