转、 discuz 改静态的方法 假设主目录为/bbs/下,利用rewrite模块,使得Discuz! 的每篇文章都变成静态html链接,使得更有利于搜索引擎收录。 必须要存在这个文件,一般2.0都有,可以放在虚拟主机中或者上面语句之间,以 结束首先在apache中加入一下语句: RewriteRule ^/bbs/index.html$ /bbs/index.php RewriteRule ^/bbs/forumdisplay_([0-9]+).html$ /bbs/forumdisplay.php?fid=$1 [L] RewriteRule ^/bbs/forumdisplay_([0-9]+)_([0-9]+).html$ /bbs/forumdisplay.php?fid=$1&page=$2 [L] RewriteRule ^/bbs/forumdisplay_digest_([0-9]+).html$ /bbs/forumdisplay.php?fid=$1&filter=digest [L] #RewriteRule ^/bbs/forumdisplay_([0-9]+)_sid_(.+).html$ /bbs/forumdisplay.php?fid=$1&sid=$2 [L] #RewriteRule ^/bbs/forumdisplay_digest_([0-9]+)_sid_(.+).html$ /bbs/forumdisplay.php?fid=$1&sid=$2&filter=digest [L] RewriteRule ^/bbs/forumdisplay_digest_([0-9]+)_([0-9]+).html$ /bbs/forumdisplay.php?fid=$1&filter=digest&page=$2 [L] RewriteRule ^/bbs/forumdisplay_([0-9]+)_sid_(.+).html$ /bbs/forumdisplay.php?fid=$1&sid=$2 [L] RewriteRule ^/bbs/forumdisplay_digest_([0-9]+)_sid_(.+).html$ /bbs/forumdisplay.php?fid=$1&sid=$2&filter=digest [L] RewriteRule ^/bbs/viewthread_([0-9]+).html$ /bbs/viewthread.php?tid=$1 [L] RewriteRule ^/bbs/viewthread_([0-9]+)_sid_(.+).html$ /bbs/viewthread.php?tid=$1&sid=$2 [L] RewriteRule ^/bbs/viewthread_([0-9]+)_([0-9]+).html$ /bbs/viewthread.php?tid=$1&page=$2 [L] RewriteRule ^/bbs/viewthread_([0-9]+)_fpage_([0-9]+).html$ /bbs/viewthread.php?tid=$1&fpage=$2 [L] RewriteRule ^/bbs/viewthread_([0-9]+)_([0-9]+)_fpage_([0-9]+).html$ /bbs/viewthread.php?tid=$1&page=$2&fpage=$3 [L] RewriteRule ^/bbs/viewthread_([0-9]+)_([0-9]+)_sid_(.+).html$ /bbs/viewthread.php?tid=$1&page=$2&sid=$3 [L] RewriteRule ^/bbs/index_([0-9]+).html$ /bbs/index.php?gid=$1 [L] #RewriteRule ^/index_([0-9]+)_sid_(.+).html$ /index.php?gid=$1&sid=$2 [L] #RewriteRule ^/(.+)_sid_(.+).html$ /$1.php?sid=$2 [L] #RewriteRule /(.+).html$ /$1.php [L] #RewriteCond %{ HTTP_REFERER } !^http://.*.shunz.net/.*$ [NC] #RewriteRule ^/attach/(.*)$ http://zanglei.com/bbs [R=301,L] 主要5个文件: forumdisplay.htm forumdisplay.php viewthread.php viewthread.html /include/global.php $forumdisplayadd .= "&filter=$filter"; 改为 $forumdisplayadd .= "_$filter"; $forumdisplayadd .= "&filter=digest"; 改为 $forumdisplayadd .= "digest_"; templates下面的index.htm forumdisplay.php?fid=$forum[fid] 改为 forumdisplay_$forum[fid].html forumdisplay.php?fid=$thread[fid] ==>forum-$thread[fid].html forumdisplay.php?fid=$fid ==>forum-$fid.html forumdisplay.php?fid=$forum[fid] ==>forum-$forum[fid].html viewthread.php?tid=$thread[tid] ==>thread-$thread[tid].html 非空数据库表作用: 1。cdb_admingroups 管理组用户 1为管理员 2。cdb_forumlinks 联盟论坛的信息 3。cdb_forum 默认论坛信息 type: group表示大论坛组 forum是论坛版面 sub是子论坛 fup : 的数字表示属于哪一个fid为这个数的版面或者group 注意allowbbcode 和allowimgcode修改是否支持ubb和img标签 4。cdb_member 注册用户的资料 5。cdb_posts 发的帖子记录 只是发的表 6。cdb_ranks 暂时未知 7。cdb_sessions 暂时未知 8。cdb_settings 论坛配置文件 每页显示多少帖子 9。cdb_smilies 各种脸形对应的文件配置 10。cdb_stats 暂时未知 11。cdb_styles 论坛的风格设置表 12。cdb_stylevars论坛风格的配置变量 13。cdb_templates论坛模板放的位置 14。cdb_threads 论坛帖子的所有信息 包括回复数目。。 15。cdb_usergroups 注册用户的权限级别 /*把上面的http://zanglei.com/bbs改成你的就可以了*/