tid=193& 本帖最後由 IT_man 於 2014-12-25 11:19 編輯
% |* c ]2 c2 y2 L" e& q, h0 m' W5 }! a- Z
在此分為「Host server設定」及「Discuz 後台設定」/ X' U/ R. H5 O
【Host server設定】 又分為Web server及站台根目錄下的.htaccess- k! I9 i- [# H4 D( O4 ^
Web server 註:有個地方須注意,/etc/httpd/conf/httpd.conf中<Directory "/www/coav4u/test"> 的 AllowOverride 一定要all,.htaccess才有作用
( X+ p G6 s/ h! R- m% V3 ?% F& B; `, ^8 }, a s8 y; H- K
站台根目錄下的.htaccess- # -FrontPage-
0 Q ^# K- ?9 O% T - IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
' E7 [4 T' g4 @# x - # disable directory browsing
& X9 X: \+ d( n; E+ S4 }* m! ` - Options All -Indexes/ u# a8 |+ J1 A. g' W5 u5 S
- RewriteEngine On # 將 RewriteEngine 模式打開
. t5 a( Y8 m1 m6 a: t% h - RewriteBase / #設定為網站的根目錄( K! g3 j* D, B0 N9 B$ V2 N( F1 U. r
- #7 p+ g, J7 s" w) G# Y2 W' } R
- RewriteCond %{HTTP_HOST} ^av4u.info [NC]
9 \# I; h0 v: U, d' h# Y# E - RewriteRule ^(.*)$ HTTP://www.av4u.info/$1 [L]<font face="楷體,標楷體"><font size="3">RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1/ [/ [. Q( h2 j
- RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%18 ~; _; y. _9 p+ x. p$ r/ f& g- e
- RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%13 h T6 A; m/ C/ {7 k% F
- RewriteRule% t3 l+ t6 F" H/ D
- ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ 9 P# C0 c! J% R+ s
- forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1. N' I- Q0 c) O" z9 Y- a
- RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1+ I% K0 K7 l+ S" ?9 `5 _5 I8 q
- RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
+ }# z6 m4 G% t, g, o$ m - RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%13 R- r! l4 U2 D
- RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1</font></font>
複製代碼 存檔後馬上生效- T. k, W/ O" k2 c( ~! ?
/ v8 S7 ]( e, B7 ?2 t- L
【Discuz 後台設定】 後台->全局->SEO設置->URL靜態化
S- W) ?: j5 H `/ }
/ N, }. h) U1 Y# @! A5 _可以全選或依據網站需要勾選
! I- F9 B3 s! T
7 C4 ]6 t" v% W# F$ x& P0 c$ r! s2 U |