歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux服務器 >> Linux下Discuz論壇實現偽靜態方法

Linux下Discuz論壇實現偽靜態方法

日期:2017/3/2 16:34:57   编辑:Linux服務器

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 © Linux教程網 All Rights Reserved