本文标签:,

一直以为GodaddyWindows主机是不支持网址重写(俗称伪静态,英文原名为URLreWrite)的功能,尝试多次也都失败收场,最近在折腾discuz,考虑到discuz X系列刚出不久,还是7.2比较成熟,不是说产品,而是说周边。其实一直以为不支持的原因,也是以为是免费空间,也就不敢要求那么多,不过今天还是找了一些,都是失败,但是终于成功了一次……

把下面的内容,复制到记事本里,保存为web.config然后放到discuz所在的文件夹就可以了,web.config是IIS7和以上版本才支持的,所以如果你的Godaddy的Windows空间的IIS版本不是6.0而是7.0,那就不能用啦,好啦,不啰嗦了,下面是代码

<?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}&amp;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}&amp;extra=page\%3D{R:3}&amp;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>

 » 订阅本站:http://feed.x2009.net