首页 > CMS建站 > Discuz > 正文

discuz X2.5 iis版 windows下 如何实现伪静态经验分享

2020-10-12 20:08:17
字体:
来源:转载
供稿:网友

这几天帮公司做一个论坛,刚接触discuz X2.5,对于如何实现伪静态,做了一番周折,终于找到了解决的方案,我的是vps,使用的是windows 03系统,在iis环境中配置方案如下:

第一步:建立一个名为 httpd.ini 的文件,可以先在电脑上面新建一个文本,然后将下面的这些代码复制到本文里面,再保存.

IIS Web Server(独立主机用户)

  1. [ISAPI_Rewrite] 
  2.  
  3. # 3600 = 1 hour 
  4. CacheClockRate 3600 
  5.  
  6. RepeatLimit 32 
  7.  
  8. # Protect httpd.ini and httpd.parse.errors files 
  9. # from accessing through HTTP 
  10. RewriteRule ^(.*)/topic-(.+)/.html(/?(.*))*$ $1/portal/.php/?mod=topic&topic=$2&$4 
  11. RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)/.html(/?(.*))*$ $1/portal/.php/?mod=view&aid=$2&page=$3&$5 
  12. RewriteRule ^(.*)/forum-(/w+)-([0-9]+)/.html(/?(.*))*$ $1/forum/.php/?mod=forumdisplay&fid=$2&page=$3&$5 
  13. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)/.html(/?(.*))*$ $1/forum/.php/?mod=viewthread&tid=$2&extra=page/=$4&page=$3&$6 
  14. RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)/.html(/?(.*))*$ $1/forum/.php/?mod=group&fid=$2&page=$3&$5 
  15. RewriteRule ^(.*)/space-(username|uid)-(.+)/.html(/?(.*))*$ $1/home/.php/?mod=space&$2=$3&$5 
  16. RewriteRule ^(.*)/blog-([0-9]+)-([0-9]+)/.html(/?(.*))*$ $1/home/.php/?mod=space&uid=$2&do=blog&id=$3&$5 
  17. RewriteRule ^(.*)/(fid|tid)-([0-9]+)/.html(/?(.*))*$ $1/index/.php/?action=$2&value=$3&$5 
  18. RewriteRule ^(.*)/([a-z]+[a-z0-9_]*)-([a-z0-9_/-]+)/.html(/?(.*))*$ $1/plugin/.php/?id=$2:$3&$5 

复制代码:将这些代码保存到文本里面以后,再将文本重命名为httpd.ini,然后再上传到网站的根目录!

第二步:接下来,我们再来到论坛的后台,全局—SEO设置—URL伪静态,然后将里面的框框全部打勾.

全部打钩好后再点击提交,OK,伪静态设置成功,然后再更新下论坛的缓存即可看到效果!

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表