用discuz x2.5的程式搭建的一個論壇,dx2.5論壇win主機與linux主機偽靜態規則的設定方法!
1
建立一個名為 httpd.ini 的檔案,可以先在電腦上面新建一個文字,然後將下面的這些程式碼複製到本文裡面,再儲存。[ISAPI_Rewrite]# 3600 = 1 hourCacheClockRate 3600RepeatLimit 32# Protect httpd.ini and httpd.parse.errors files# from accessing through HTTPRewriteRule ^(.*)/topic-(.+).html(?(.*))*$ $1/portal.php?mod=topic&topic=$2&$4RewriteRule ^(.*)/article-([0-9]+)-([0-9]+).html(?(.*))*$ $1/portal.php?mod=view&aid=$2&page=$3&$5RewriteRule ^(.*)/forum-(w+)-([0-9]+).html(?(.*))*$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3&$5RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+).html(?(.*))*$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3&$6RewriteRule ^(.*)/group-([0-9]+)-([0-9]+).html(?(.*))*$ $1/forum.php?mod=group&fid=$2&page=$3&$5RewriteRule ^(.*)/space-(username|uid)-(.+).html(?(.*))*$ $1/home.php?mod=space&$2=$3&$5RewriteRule ^(.*)/blog-([0-9]+)-([0-9]+).html(?(.*))*$ $1/home.php?mod=space&uid=$2&do=blog&id=$3&$5RewriteRule ^(.*)/(fid|tid)-([0-9]+).html(?(.*))*$ $1/index.php?action=$2&value=$3&$5將這些程式碼儲存到文字裡面以後,再將文字重新命名為httpd.ini ,然後再上傳到網站的根目錄!)/forum-(w+)-([0-9]+).html(?(.*))*$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3&$5RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+).html(?(.*))*$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3&$6RewriteRule ^(.*)/group-([0-9]+)-([0-9]+).html(?(.*))*$ $1/forum.php?mod=group&fid=$2&page=$3&$5RewriteRule ^(.*)/space-(username|uid)-(.+).html(?(.*))*$ $1/home.php?mod=space&$2=$3&$5RewriteRule ^(.*)/blog-([0-9]+)-([0-9]+).html(?(.*))*$ $1/home.php?mod=space&uid=$2&do=blog&id=$3&$5RewriteRule ^(.*)/(fid|tid)-([0-9]+).html(?(.*))*$ $1/index.php?action=$2&value=$3&$5將這些程式碼儲存到文字裡面以後,再將文字重新命名為httpd.ini ,然後再上傳到網站的根目錄!2
接下來,我們再來到論壇的後台,全域性—SEO設定—URL偽靜態,然後將裡面的框框全部打勾,如下圖:
3
全部打鉤好後再點選提交,OK,偽靜態設定成功,然後再更新下論壇的快取即可看到效果!1
新建一個文字,然後將這些程式碼複製入文字裡面:RewriteEngine OnRewriteBase /# Rewrite 系統規則請勿修改RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^topic-(.+).html$ portal.php?mod=topic&topic=$1&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^article-([0-9]+)-([0-9]+).html$ portal.php?mod=view&aid=$1&page=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^forum-(w+)-([0-9]+).html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+).html$ forum.php?mod=viewthread&tid=$1&extra=page%3D$3&page=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^group-([0-9]+)-([0-9]+).html$ forum.php?mod=group&fid=$1&page=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^space-(username|uid)-(.+).html$ home.php?mod=space&$1=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^([a-z]+)-(.+).html$ $1.php?rewrite=$2&%12&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+).html$ forum.php?mod=viewthread&tid=$1&extra=page%3D$3&page=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^group-([0-9]+)-([0-9]+).html$ forum.php?mod=group&fid=$1&page=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^space-(username|uid)-(.+).html$ home.php?mod=space&$1=$2&%1RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^([a-z]+)-(.+).html$ $1.php?rewrite=$2&%14
上傳以後到論壇後台,全域性—SEO設定—URL偽靜態,然後將裡面的框框全部打勾,再更新下快取即可看到偽靜態的效果!