抓虾 鲜果
google reader QQ邮箱

伪静态主要是针对搜索引擎处理的,本身反而会加重服务器的负担,而且Discuz!的伪静态还没有301定向功能,是伪静态和动态并行,这样将出现重复页面,对搜索引擎其实也不好。当然这不是今天要讲的,今天要讲的是Discuz伪静态.htaccess规则,当然首先你的主机要支持.htaccess规则,国内很多主机都不支持的。

具体操作步骤如下:

1、将您已经建立的.htaccess文件下载到本地,或者进入主机控制面版,找到您要修改的.htaccess文件,点击“编辑”即可进行编辑;

2、将以下规则添加到.htaccess文件中,按照规则中的说明进行修改,并提交保存;

1
2
3
4
5
6
7
8
9
10
# 将 RewriteEngine 模式打开
RewriteEngine On
# 修改以下语句中的 /bbs 为你的论坛目录地址,如果程序放在根目录中,请将 /bbs 修改为 /
RewriteBase /bbs
# Rewrite 系统规则请勿修改
RewriteRule ^archiver/((fid|tid)-[\w\-]+\.html)$ archiver/index.php?$1
RewriteRule ^forum-([0-9]+)-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2
RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ viewthread.php?tid=$1&extra=page\%3D$3&page=$2
RewriteRule ^space-(username|uid)-(.+)\.html$ space.php?$1=$2
RewriteRule ^tag-(.+)\.html$ tag.php?name=$1

3、将您修改好的.htaccess文件上传覆盖即可,如果是在线直接修改的,则跳过此步;

4、进入Discuz论

相关文章

7 Responses to “Discuz伪静态.htaccess规则”

  1. 星网 说道:

    我还没弄过Discuz呢,会一点WordPress就已经不得了啦!

    悄悄告诉你哦,你的评论被我收集了!公布到文章页了咯!

    [回复]

  2. jiaqi 说道:

    这个不错,学习了

    [回复]

  3. 淘宝化妆品 说道:

    谢谢你的文章,我的问题解决了!!

    [回复]

  4. Clemente Kondo 说道:

    There’s some superb info here. If more people were aware of this, our world would be a much happier place! I can clearly see that you’ve invested a lot of effort into this article. Please keep up the good work; the world deserves it!

    [回复]

  5. reading pillow 说道:

    You got a very valuable weblog website I’ve been previously ideal here looking at for about some time already. I’m a novice also as your accomplishment is very drastically an ideas to me. Maintain up the great article!

    [回复]

  6. Clint 说道:

    B.O would appreciate to dismantle The usa. They’re undertaking what the crna can. Now the bastared is going out of your time.

    [回复]

  7. Bijal 说道:

    Person is not no fee except govt is confined. There may be a definite lead to and result correct the following that is obviously a well put together and expected like a law of physics: As government expands, liberty contracts. -Ronald Regan

    [回复]

Leave a Reply