tid=193& 本帖最後由 IT_man 於 2014-12-25 11:19 編輯
, `# l" M- j( {6 M& C% t7 z. i0 S7 D- _
在此分為「Host server設定」及「Discuz 後台設定」" X& `+ }' S. P' `- J- V
【Host server設定】 又分為Web server及站台根目錄下的.htaccess
6 P8 ]; l1 E4 M$ Y Web server 註:有個地方須注意,/etc/httpd/conf/httpd.conf中<Directory "/www/coav4u/test"> 的 AllowOverride 一定要all,.htaccess才有作用) ]/ \: Q' s$ Z3 t. w6 l
% f( {4 C5 n- T3 E 站台根目錄下的.htaccess- # -FrontPage-
* E+ u" e6 }. s B# e# I - IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti* , N; k4 o7 ]# s* d3 Q! {, f, N
- # disable directory browsing
. `4 D7 P; N) B/ o0 q9 `% a8 b; L; k: W - Options All -Indexes
( T8 o) y8 z- ]* [9 Z7 @2 V5 j7 s - RewriteEngine On # 將 RewriteEngine 模式打開* X6 w. X" `% G0 O& J6 \
- RewriteBase / #設定為網站的根目錄
) @6 c5 U5 A2 G0 |4 L* l8 c - #
$ e, u( C# u1 i( r: z - RewriteCond %{HTTP_HOST} ^av4u.info [NC]
' c0 v8 O& q D - RewriteRule ^(.*)$ HTTP://www.av4u.info/$1 [L]<font face="楷體,標楷體"><font size="3">RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1& g% X, x9 A6 C0 k
- RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1 D, c& @2 C- S' z# l$ ?/ l, p
- RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1# p) P' H3 J# _
- RewriteRule
* o7 p( A( u) r! e5 ~ - ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ : P0 h: D" l0 H N6 A
- forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1& {1 P& W2 L" S# ?' d' X
- RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
& ]. k7 H, k: a. _' H! v; i1 O' a - RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
8 [0 s) @$ h7 H9 Y1 `, g - RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%11 t. Y" H3 y2 l% N6 r0 ?# M j
- RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1</font></font>
複製代碼 存檔後馬上生效
2 h6 D; x& g8 G" r
9 s3 k9 t B3 v6 }" {【Discuz 後台設定】 後台->全局->SEO設置->URL靜態化6 X8 d6 c5 p# L( M( U
- A3 c* m, a: i& b
可以全選或依據網站需要勾選$ Z: y. S( w% O6 {2 z
/ D, Y. k2 L$ d4 s, ^
|