论坛伪静态(新手傻瓜教程)虚拟主机用户解决方案
# 将 RewriteEngine 模式打开 RewriteEngine On # 修改以下语句中的 domain 为你的论坛地址 RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301] # 修改以下语句中的 /discuz 为你的论坛目录地址,如果程序放在根目录中,请将 /discuz 修改为 / RewriteBase / # Rewrite 系统规则请勿修改 RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1 RewriteRule ^article-([0-9]+)\.html$ portal.php?mod=article&articleid=$1 RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2 RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2 RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2 RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2 RewriteRule ^([a-z]+)-(.+)\.html$ $1.php?rewrite=$2 3.保存文件,将修改后的.htaccess文件上传到论坛更目录 4.在论坛后台开启静态 5.更新缓存. OK Windows 系统: 建一个httpd.ini文档,内容如下,发到你的根目录下就行了。 [ISAPI_Rewrite] # 3600 = 1 hour CacheClockRate 3600 RepeatLimit 32 # Protect httpd.ini and httpd.parse.errors files # from accessing through HTTP RewriteRule ^/home/(space|network)-(.+)\.html$ /home/$1\.php\?rewrite=$2 [L] RewriteRule ^/home/(space|network)\.html$ /home/$1\.php [L] RewriteRule ^/home/([0-9]+)$ /home/space\.php\?uid=$1 [L] RewriteRule ^(.*)/archiver/((fid|tid)-[\w\-]+\.html)\?*(.*)$ $1/archiver/index\.php\?$2&$4 RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forumdisplay\.php\?fid=$2&page=$3&$4 RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/viewthread\.php\?tid=$2&extra=page\%3D$4&page=$3&$4 RewriteRule ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$ $1/space\.php\?$2=$3&$4 RewriteRule ^(.*)/tag-(.+)\.html\?*(.*)$ $1/tag\.php\?name=$2&$3