本帖最後由 IT_man 於 2014-12-25 11:19 編輯
. n4 \ Q( u5 f2 j$ _ }6 ]3 ?
在此分為「Host server設定」及「Discuz 後台設定」
& }7 w& O9 z3 z/ g( ^【Host server設定】 又分為Web server及站台根目錄下的.htaccess
3 b. O6 d/ r: y% b, H) O+ i; J Web server 註:有個地方須注意,/etc/httpd/conf/httpd.conf中<Directory "/www/coav4u/test"> 的 AllowOverride 一定要all,.htaccess才有作用; M' M' h/ Z2 B: x
s% Z; F, S' }7 I6 T1 u6 e/ P
站台根目錄下的.htaccess- # -FrontPage-
$ k! v/ C; }5 q. B+ @ - IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti* $ ]- ]& @/ I8 V; _) u/ E4 b
- # disable directory browsing
0 O% ^/ T: C2 O2 H# H. k- e - Options All -Indexes
& X: a8 i1 x& E b - RewriteEngine On # 將 RewriteEngine 模式打開8 @. K5 J) ?) k2 O0 k" \
- RewriteBase / #設定為網站的根目錄- R0 g: \0 v5 o$ r' n; a1 N4 g
- #3 L7 h+ ^+ v1 f4 E# G% y9 ]& `8 o
- RewriteCond %{HTTP_HOST} ^av4u.info [NC]
; b: X$ z) _' |$ F. a - RewriteRule ^(.*)$ HTTP://www.av4u.info/$1 [L]<font face="楷體,標楷體"><font size="3">RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1" x& _" k! X9 P
- RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%11 H- B- F2 I/ Z* C* Q
- RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%10 z0 d; f% ~, _, n8 W; o, @
- RewriteRule; e$ r" p; J/ i$ U) v/ @
- ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ 6 \9 @8 C& v! i) \( G
- forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
4 u1 Z& t" {( p# f$ R( c$ H8 Y3 U1 X - RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
& H5 n' X5 _9 Q; q - RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1$ P8 ?, ]# k% |* j
- RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%11 |/ _5 E5 N K) e0 X
- RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1</font></font>
複製代碼 存檔後馬上生效% ?7 U# ^5 F7 Y* {3 Y
- _% p$ c; @+ j9 u( j6 I6 ~【Discuz 後台設定】 後台->全局->SEO設置->URL靜態化' }0 ?3 w2 X5 H! a1 V7 d% g1 B
: S" B0 \0 h8 C3 C7 H
可以全選或依據網站需要勾選( [2 c4 c' F+ s$ S
( W3 K j" O" D1 Y+ N4 i" c6 n1 b, Q
|
|