linux apache下的discuz論壇偽靜態(tài)
linux apache 空間的偽靜態(tài),是通過.htaccess文件實現(xiàn)的。
您把靜態(tài)代碼,存成.htaccess文件,放到網(wǎng)站根目錄下即可。
我們現(xiàn)在以discuz2.0為例,代碼如下:
RewriteEngine On RewriteBase /discuz RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ plugin.php?id=$1:$2&%1
為了方便大家使用,這里已經(jīng)存好了.htaccess文件,下載解壓后,把.htaccess文件通過FTP傳到您網(wǎng)站根目錄下,DISCUZ后臺打開偽靜態(tài)功能即可。
點擊下載壓縮文檔,將解壓后的.htaccess文件放到網(wǎng)站根目錄下
discuz 3.0以版本,我們未經(jīng)過測試,請自行去找discuz官網(wǎng)論壇,找相關(guān)版本的偽靜態(tài)代碼,按照上面方式制作即可