Linux下Discuz论坛实现伪静态方法


linux系统下,我们可以修改或者添加.htaccess 文件来实现discuz的伪静态。

  1. 文章中引用的部分,则是实现伪静态的方法!我们在桌面建立一个记事本,将引用中的内容复制,保存-另存为(保存类型为所有文件,保存文件夹名为.htaccess)

  2. 如果论坛在网站的根目录,那么我们把保存的.htaccess文件上传到网站的根目录即可!如果论坛是二级域名,访问方式为bbs.xxx.com,那么我们就要把文件放bbs件夹内。

  3. 值得注意的是引用中的红色字体部分,RewriteBase /  指的是网站的根目录,如果你的论坛访问方式为 www.xxx.com/bbs  那么这句话就应该修改为RewriteBase /bbs ,然后把文件上传到bbs文件夹即可!

  # 将 RewriteEngine 模式打开

  RewriteEngine On

  # 修改以下语句中的 /discuz 为你的论坛目录地址,如果程序放在根目录中,请将 /discuz 修改为 /

  RewriteBase /

  # Rewrite 系统规则请勿修改

  RewriteRule ^archiver/((fid|tid)-[0-9]+\.html)$ archiver/index.php?{GetProperty(Content)}

  RewriteRule ^forum-([0-9]+)-([0-9]+)\.html$ forumdisplay.php?fid={GetProperty(Content)}&page=$2

  RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ viewthread.php?tid={GetProperty(Content)}&extra=page\%3D$3&page=$2

  RewriteRule ^space-(username|uid)-(.+)\.html$ space.php?{GetProperty(Content)}=$2

  RewriteRule ^tag-(.+)\.html$ tag.php?name={GetProperty(Content)}


« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3