tid=193& 本帖最後由 IT_man 於 2014-12-25 11:19 編輯 " V2 @, u; Q& p" g
5 n5 n: L+ X$ r9 x0 {) }( H# n2 C在此分為「Host server設定」及「Discuz 後台設定」
) E7 h3 @, d# S【Host server設定】 又分為Web server及站台根目錄下的.htaccess
5 U+ H/ `, U7 i# a5 k+ q Web server 註:有個地方須注意,/etc/httpd/conf/httpd.conf中<Directory "/www/coav4u/test"> 的 AllowOverride 一定要all,.htaccess才有作用
2 A% H, D( L0 C k3 K [: I3 w y/ e! c. r5 c) R8 B
站台根目錄下的.htaccess- # -FrontPage-
3 y- ?: a7 [3 }& z8 }9 R - IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
& q a) s3 J* Z! t - # disable directory browsing
5 U+ r8 J! @* K# D - Options All -Indexes5 i/ \! p( Y4 L* e$ n# ^
- RewriteEngine On # 將 RewriteEngine 模式打開
; y5 l2 r: e6 u. s2 }; _! I - RewriteBase / #設定為網站的根目錄
6 {0 {& n1 V5 f& c) D* U - #( s4 K, W' |; p9 B6 I* x. y
- RewriteCond %{HTTP_HOST} ^av4u.info [NC]
2 ~! \8 X" h: F* i; V0 ~ - RewriteRule ^(.*)$ HTTP://www.av4u.info/$1 [L]<font face="楷體,標楷體"><font size="3">RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1+ _! Y* |4 e% G( j( \1 W
- RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
9 m( \. F, v. r- | - RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%13 I- H5 i c v4 g3 V
- RewriteRule/ {7 w5 a8 T5 G
- ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ % X8 U7 |) W3 \' r
- forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
6 P+ y% U, G0 D+ R - RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1% `' P; G6 y" w' f
- RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%19 P% s. P5 h+ D/ ~8 N( s
- RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1- I9 X# x% c# _8 Q
- RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1</font></font>
複製代碼 存檔後馬上生效
9 w4 m/ S, r1 N& t3 t+ _
5 |, n' ~( D R& R/ k: @【Discuz 後台設定】 後台->全局->SEO設置->URL靜態化3 z f. z& g$ ]. T) S5 e
. P0 A) {! t& K! g" K a8 c
可以全選或依據網站需要勾選) }+ c. B! {/ Z/ Y
0 z: i. e9 G" d9 T; ^8 d Q |