在dreamhost实现discuz的伪静态化

Filed under: 程序开发 | 3 Comments »
Posted on


Options +FollowSymLinks
# 将 RewriteEngine 模式打开
RewriteEngine On
# 修改以下语句中的 / 为你的论坛目录地址,如果程序放在根目录中,请将 / 修改为 /
RewriteBase /

# 系统规则请勿修改
RewriteRule ^archiver/([a-z0-9\-]+\.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 ^profile-(username|uid)-(.+)\.html$ viewpro.php?$1=$2
RewriteRule ^space-(username|uid)-(.+)\.html$ space.php?$1=$2
RewriteRule ^tag-(.+)\.html$ tag.php?name=$1
由于windows下不支持.htaccess文件,因此将上面的代码保存为一个文本文件,将这个文本文件传到DH的空间后改名为.htaccess,然后在后台管理中的“基本设置-搜索引擎优化”中选择“URL 静态化”的相应的值,即可实现在dreamhost空间中的discuz的伪静态化。
伪静态化后的样例可访问:http://www.c3h3studio.com/

(增加了tag.php对应的rewrite规则 2007-8-23)

相关文章