Discuz比较适合于Apache环境。现在比较流行的组合模式为 IIS+ASP.net 和 Apache+ PHP。在 Microsoft-IIS 上配置 Discuz 论坛系统相对比较麻烦。但是如果你没有办法才选择了windows系统下的 “Microsoft-IIS/6.0 ”服务器软件,那么你得考虑如何配置主机以达到网站伪静态化的效果了。下面介绍如何配置以实现网站在 Microsoft-IIS/6.0 环境下的伪静态化。
- 首先,确保你的主机环境支持伪静态,也就是说确认你的主机是否支持rewrite伪静态httpd.ini文件,可以和主机服务商联系询问。
- 然后,进入后台,找到“全局”——“SEO设置”,如图,把右边“可用”下方的框全给勾选(或选择性勾选)。
- 此时,到网站首页,刷新一下,你会看到你的网站地址全变成了伪静态,也就是html结尾的文章或者栏目地址,但是你点进去,会发现出现无法打开页面,是因为你虽然设置了伪静态,却没做伪静态化处理。复制下面代码到记事本,保存为http.ini,然后上传到空间根目录即可。
- [ISAPI_Rewrite]
- # 3600 = 1 hour
- CacheClockRate 3600
- RepeatLimit 32
- # Protect httpd.ini and httpd.parse.errors files
- # from accessing through HTTP
- RewriteRule ^(.*)/topic-(.+)\.html(\?(.*))*$ $1/portal\.php\?mod=topic&topic=$2&$4
- RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/portal\.php\?mod=view&aid=$2&page=$3&$5
- RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=forumdisplay&fid=$2&page=$3&$5
- RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$6
- RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=group&fid=$2&page=$3&$5
- RewriteRule ^(.*)/space-(username|uid)-(.+)\.html(\?(.*))*$ $1/home\.php\?mod=space&$2=$3&$5
- RewriteRule ^(.*)/blog-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/home\.php\?mod=space&uid=$2&do=blog&id=$3&$5
- RewriteRule ^(.*)/(fid|tid)-([0-9]+)\.html(\?(.*))*$ $1/index\.php\?action=$2&value=$3&$5
- RewriteRule ^(.*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html(\?(.*))*$ $1/plugin\.php\?id=$2:$3&$5
万事大吉?也许。但是有部分用户会发现问题依旧,原因是你保存 http.ini 文件的时候编码不对,正确的编码应该为 “ANSI”,其他格式无效。 这次上传到更目录后刷新试试,应该可了。 祝大家一切顺利!
0 评论 :
发表评论