本帖最後由 IT_man 於 2014-12-25 11:19 編輯
8 Y2 ?7 S# F/ Y4 k6 H; V- T! T% b B: o# r
在此分為「Host server設定」及「Discuz 後台設定」
% a5 z; ?9 U, e8 H+ i【Host server設定】 又分為Web server及站台根目錄下的.htaccess
; }" A! _7 |9 v Web server 註:有個地方須注意,/etc/httpd/conf/httpd.conf中<Directory "/www/coav4u/test"> 的 AllowOverride 一定要all,.htaccess才有作用9 h h: X" o# ?/ a' v
" e, U d2 Y+ W' o) `. M 站台根目錄下的.htaccess- # -FrontPage-
$ F$ R$ `7 R7 |# a- N" u: y' F - IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti* ! r- j: X1 [0 U( p/ s8 a
- # disable directory browsing) {& y' A, M! s. E: u0 q1 U. b
- Options All -Indexes9 C9 d$ ?$ v( `
- RewriteEngine On # 將 RewriteEngine 模式打開* t% I: e0 B& k6 s
- RewriteBase / #設定為網站的根目錄( y& f; G A* G
- #5 a7 T) R) k* [+ v+ y) l$ \& e
- RewriteCond %{HTTP_HOST} ^av4u.info [NC]# h( f+ `4 Q; C. |
- RewriteRule ^(.*)$ HTTP://www.av4u.info/$1 [L]<font face="楷體,標楷體"><font size="3">RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1
6 R- a9 ]0 C! U3 @ - RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%10 O& _7 M0 M1 _- G |( q
- RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1* [. Q# T$ @" V- p: S- ?7 ?: N
- RewriteRule) N* f( X" K% U
- ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ - c2 R6 p& M7 k! K# Z
- forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
$ _, P8 @4 f; K) D- z5 _4 J - RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%10 a7 h/ d' w& p
- RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%10 d: k5 Y: x$ a- q8 M
- RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%14 F) b( E. |; b: @& U2 G* N
- RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1</font></font>
複製代碼 存檔後馬上生效$ G* R# w. g# l% A/ [9 I- q5 _ \
]/ k" P& q( O【Discuz 後台設定】 後台->全局->SEO設置->URL靜態化
+ I' Z1 ?+ X! }, u5 ]
: W& C4 |. @1 L6 k4 I
可以全選或依據網站需要勾選
) ^; c8 _' S) z" t, ]& V5 P8 ~# k- ?# c6 H
|
|