PDA

View Full Version : [求助] iis7主机下discuz x3.4静态规则添*方法



zhiheng123
09-17-2018, 11:04 AM
本帖最后由 skyyna 于 2017-8-16 21:21 编辑 [/i]
黄石社区网(www.hsbbs.cn)新安装DISCUZ X3.4有*天了,记录下IIS7.5开启URL伪静 方法。业余站长小记,大*请飘过。
感谢原作者CRX349贡献代*,
原贴*:http://www.discuz.net/thread-3191765-1-1.html
我的程序安装IIS7.5独立主机上,用的 web.config配置文件。
http://www.discuz.net/static/image/common/none.gif
服务器信息.png (14.74 KB, 下载次数: 0)
下载附件 (forum.php?mod=attachment&aid=MTgwOTg2M3xmYjIyZjgwZXwxNTM2OTE4NjI0fDB8MzgzMT I3NA%3D%3D&nothumb=yes)
X3.4安装环境
2017-8-16 20:39 上*
打开在论坛*目录的web.config文件。
代*如下:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpErrors errorMode="Custom">
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="404.html" responseMode="File" />
</httpErrors>
</system.webServer>
</configuration>
复制代*
找到如下代*:
<httpErrors errorMode="Custom">复制代*在它的前面*上如下规则代* ,保*后就OK啦:
<rewrite>
<rules>
<rule name="portal_topic">
<match url="^(.*/)*topic-(.+).html\?*(.*)[ DISCUZ_CODE_2 ]quot; />
<action type="Rewrite" url="{R:1}/portal.php\?mod=topic&topic={R:2}&{R:3}" />
</rule>
<rule name="portal_article">
<match url="^(.*/)*article-([0-9]+)-([0-9]+).html\?*(.*)[ DISCUZ_CODE_2 ]quot; />
<action type="Rewrite" url="{R:1}/portal.php\?mod=view&aid={R:2}&page={R:3}&{R:4}" />
</rule>
<rule name="forum_forumdisplay">
<match url="^(.*/)*forum-(\w+)-([0-9]+).html\?*(.*)[ DISCUZ_CODE_2 ]quot; />
<action type="Rewrite" url="{R:1}/forum.php\?mod=forumdisplay&fid={R:2}&page={R:3}&{R:4}" />
</rule>
<rule name="forum_viewthread">
<match url="^(.*/)*thread-([0-9]+)-([0-9]+)-([0-9]+).html\?*(.*)[ DISCUZ_CODE_2 ]quot; />
<action type="Rewrite" url="{R:1}/forum.php\?mod=viewthread&tid={R:2}&extra=page%3D{R:4}&page={R:3}&{R:5}" />
</rule>
<rule name="group_group">
<match url="^(.*/)*group-([0-9]+)-([0-9]+).html\?*(.*)[ DISCUZ_CODE_2 ]quot; />
<action type="Rewrite" url="{R:1}/forum.php\?mod=group&fid={R:2}&page={R:3}&{R:4}" />
</rule>
<rule name="home_space">
<match url="^(.*/)*space-(username|uid)-(.+).html\?*(.*)[ DISCUZ_CODE_2 ]quot; />
<action type="Rewrite" url="{R:1}/home.php\?mod=space&{R:2}={R:3}&{R:4}" />
</rule>
<rule name="home_blog">
<match url="^(.*/)*blog-([0-9]+)-([0-9]+).html\?*(.*)[ DISCUZ_CODE_2 ]quot; />
<action type="Rewrite" url="{R:1}/home.php\,b2b免费商务平台 (http://www.izhushang.com/sell/)www.izhushang.com?mod=space&uid={R:2}&do=blog&id={R:3}&{R:4}" />
</rule>
<rule name="forum_archiver">
<match url="^(.*/)*(fid|tid)-([0-9]+).html\?*(.*)[ DISCUZ_CODE_2 ]quot; />
<action type="Rewrite" url="{R:1}/index.php\?action={R:2}&value={R:3}&{R:4}" />
</rule>
<rule name="plugin">
<match url="^(.*/)*([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+).html\?*(.*)[ DISCUZ_CODE_2 ]quot; />
<action type="Rewrite" url="{R:1}/plugin.php\?id={R:2}:{R:3}&{R:4}" />
</rule>
</rules>
</rewrite>复制代*