本帖最後由 IT_man 於 2014-12-25 11:19 編輯 1 o4 A2 E B; e6 A% |0 ]
6 V) @& \. N! b' K; i" C; O2 _0 ^7 h在此分為「Host server設定」及「Discuz 後台設定」6 d3 n9 T, }3 J/ a
【Host server設定】 又分為Web server及站台根目錄下的.htaccess
' T& j0 y# N5 Q* |( v8 t+ {+ ?, I Web server 註:有個地方須注意,/etc/httpd/conf/httpd.conf中<Directory "/www/coav4u/test"> 的 AllowOverride 一定要all,.htaccess才有作用* N5 l" D' a0 P3 U
' S, U* f2 C; E8 ~; o: F5 y. z; `
站台根目錄下的.htaccess- # -FrontPage-5 l! V$ o b; w; c6 S% p
- IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti* 9 N/ l# |0 ?& |* a: Y7 }7 p# Q5 `# k
- # disable directory browsing
* R& a* K; J( Y0 R - Options All -Indexes! s! w5 c. I y/ e
- RewriteEngine On # 將 RewriteEngine 模式打開/ {2 G8 |- D& B/ z J3 k; i
- RewriteBase / #設定為網站的根目錄
: w! U% |% V& }. }* P - #% A% s: j. {8 V6 d2 ~# T! K
- RewriteCond %{HTTP_HOST} ^av4u.info [NC]% H' ~" r! z d5 T
- RewriteRule ^(.*)$ HTTP://www.av4u.info/$1 [L]<font face="楷體,標楷體"><font size="3">RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%17 Q6 c S. {2 R: F. q. n* C* V! l( ~
- RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
* E* Z: E% @6 g! Q' K - RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%14 K. ~7 y! N6 r
- RewriteRule* g! W& O! T% ]
- ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ 7 }: j! `# f( K5 [5 S
- forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
8 r9 Q; c% g' \0 B9 Z - RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
9 h+ |1 _4 N, T! ?0 z S, }9 i - RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1& m, {/ \$ A2 m7 B0 y7 x5 r! j( k3 z+ _
- RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1* E! B7 H' d( u. D
- RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1</font></font>
複製代碼 存檔後馬上生效
0 i7 M6 {0 s- Z4 y* w 0 p9 A0 t1 w0 E$ T2 V) C i
【Discuz 後台設定】 後台->全局->SEO設置->URL靜態化6 v3 B1 D3 _# ]* v; y& K
8 J% s0 v; B0 M可以全選或依據網站需要勾選4 r/ y: }8 w6 p6 h1 X+ \
9 L* w3 T3 U. N5 z- E8 P9 z |
|