tid=193& 本帖最後由 IT_man 於 2014-12-25 11:19 編輯
5 {3 ]" _% n9 \8 R+ K4 c5 C G# T$ e5 P, L
在此分為「Host server設定」及「Discuz 後台設定」
5 x. @% b; P) ~+ O0 B3 I( ?! f" I【Host server設定】 又分為Web server及站台根目錄下的.htaccess
9 D) v7 G9 D/ d Web server 註:有個地方須注意,/etc/httpd/conf/httpd.conf中<Directory "/www/coav4u/test"> 的 AllowOverride 一定要all,.htaccess才有作用
! `( n/ z8 d8 \. U- }4 C6 ~
0 J- \& o) C$ } 站台根目錄下的.htaccess- # -FrontPage-
1 ~ B0 K4 h" X$ a4 A! E4 w2 c( ?! m - IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
% e7 F. p3 S P( t) a9 k# P0 c - # disable directory browsing
8 t, G! k$ e8 j; i& t) L/ Q, e - Options All -Indexes
R7 M8 O( `9 \. C - RewriteEngine On # 將 RewriteEngine 模式打開
) ^! |4 [: h5 H$ s8 Z$ D - RewriteBase / #設定為網站的根目錄" Y9 X# s. H, j6 n3 s- W% E& z- H
- #
; G" T \2 m2 e, y" u5 M! g; { - RewriteCond %{HTTP_HOST} ^av4u.info [NC]
5 a1 z8 x7 \! y# ~3 i& Y - RewriteRule ^(.*)$ HTTP://www.av4u.info/$1 [L]<font face="楷體,標楷體"><font size="3">RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1
0 o" r3 g3 }" \" ~ - RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%10 f6 Y' H$ l! ?6 A, ^
- RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
/ M6 f- f" Z9 i$ E! T - RewriteRule2 K$ O2 d4 H/ Q& i1 q
- ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ " u$ K w5 k% M" l1 X$ b0 l, @+ L
- forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1/ f" J. i7 H) ?% w
- RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%15 c& ] b* U# m8 ]. n" Z+ l
- RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
$ J* E6 [7 w; z. p% G - RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1+ ?' H8 o" T& V
- RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1</font></font>
複製代碼 存檔後馬上生效$ _/ }% h& s) N% t" g/ _
5 F3 X. A5 q1 Z- Y! X
【Discuz 後台設定】 後台->全局->SEO設置->URL靜態化3 o' H3 h: r, A2 q* @$ g+ Y
% A4 B9 P! w; V可以全選或依據網站需要勾選
2 D" N: w, a5 R4 k" l7 ]6 f% d* h2 M P8 A. n% X3 ^
|