将论坛的页面输出为 HTML 启用方法
1. 确保您的服务器支持 Rewrite (一般情况下, Apache, Zeus 都可以支持)。如果服务器是 IIS,需要使用相关插件来实现(不推荐)
2. 向论坛所在目录上传名为 “.htaccess”的文件(不包括引号),内容为:
Apache Web Server
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /bbs
RewriteRule ^index.html$ index.php
RewriteRule ^forums_([0-9]+).html$ forums.php?forumid=$1
RewriteRule ^forums_([0-9]+)_([0-9]+).html$ forums.php?forumid=$1&page=$2
RewriteRule ^forums_([0-9]+)_([0-9]+)_([a-zA-Z0-9]*)_([a-zA-Z]*)_([a-zA-Z]*).html$ forums.php?forumid=$1&page=$2&jinhua=$3&listby=$4&trash=$5
RewriteRule ^topic_([0-9]+).html$ topic.php?filename=$1
RewriteRule ^topic_([0-9]+)_([a-zA-Z0-9]*).html$ topic.php?filename=$1&page=$2
</IfModule>
ISAPI Rewrite
[ISAPI_Rewrite]
CacheClockRate 3600
RepeatLimit 32
RewriteBase /bbs
RewriteRule ^index.html$ index.php
RewriteRule ^forums_([0-9]+).html$ forums.php\?forumid=$1
RewriteRule ^forums_([0-9]+)_([0-9]+).html$ forums.php\?forumid=$1&page=$2
RewriteRule ^forums_([0-9]+)_([0-9]+)_([a-zA-Z0-9]*)_([a-zA-Z]*)_([a-zA-Z]*).html$ forums.php\?forumid=$1&page=$2&jinhua=$3&listby=$4&trash=$5
RewriteRule ^topic_([0-9]+).html$ topic.php\?filename=$1
RewriteRule ^topic_([0-9]+)_([a-zA-Z0-9]*).html$ topic.php\?filename=$1&page=$2
Zeus Web Server
在虚拟主机配置中找到 Request Rewriting,在 Rewrite Script 中写入以下内容,然后 Apply changes 并 make it take effect。
match URL into $ with ^(.*)/forums_([0-9]+)\.html$
if matched then
set URL = $1/forums.php?forumid=$2
endif
match URL into $ with ^(.*)/forums_([0-9]+)_([0-9]+)_([a-zA-Z0-9]*)_([a-zA-Z]*)_([a-zA-Z]*)\.html$
if matched then
set URL = $1/forums.php?forumid=$2&page=$3&jinhua=$4&listby=$5&trash=$6
endif
match URL into $ with ^(.*)/forums_([0-9]+)_([0-9]+)\.html$
if matched then
set URL = $1/forums.php?forumid=$2&page=$3
endif
match URL into $ with ^(.*)/topic-([0-9]+)\.html$
if matched then
set URL = $1/topic.php?filename=$2
endif
match URL into $ with ^(.*)/topic_([0-9]+)_([a-zA-Z0-9]*)\.html$
if matched then
set URL = $1/topic.php?filename=$2&page=$3
endif
注意,请将所有的 /bbs/ 替换为论坛所在路径,例如:
http://www.hellobmf.com/forum/ 的路径则为 /forum/
http://bbs.hellobmf.com/ 的路径则为 /
3. 进入论坛管理中心,设置常规选项,将 采用 Rewrite 伪装 HTML 页面 选项打开