tid=193& 本帖最後由 IT_man 於 2014-12-25 11:19 編輯
$ f# N8 @6 `$ j1 p) J7 c9 p; P# g, S% f, K6 t) U
在此分為「Host server設定」及「Discuz 後台設定」
b5 Y' m, X. ?/ G O+ g【Host server設定】 又分為Web server及站台根目錄下的.htaccess
% U& q1 A l2 F1 ~ Web server 註:有個地方須注意,/etc/httpd/conf/httpd.conf中<Directory "/www/coav4u/test"> 的 AllowOverride 一定要all,.htaccess才有作用6 e6 {6 a& u) B1 m6 [) C/ Y; v
) b/ q) y) Y) ~4 s! U, ^
站台根目錄下的.htaccess- # -FrontPage-! v8 y: C% `4 e5 l3 A
- IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
$ F5 X) f0 j" F1 z - # disable directory browsing
! r( X" h4 J+ c9 ]& A0 D$ T q. B, f - Options All -Indexes4 ?- R; s) G! i+ z7 E
- RewriteEngine On # 將 RewriteEngine 模式打開4 v# D+ j2 x- }# v( o" z$ U
- RewriteBase / #設定為網站的根目錄
3 \1 Z' k& c7 [& A+ E9 t - #
* d0 L4 ]2 C; V- f5 W9 E0 r% v9 A - RewriteCond %{HTTP_HOST} ^av4u.info [NC]( u# K& f0 u* t" A
- RewriteRule ^(.*)$ HTTP://www.av4u.info/$1 [L]<font face="楷體,標楷體"><font size="3">RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%15 j- ^1 \0 c: O9 l" }+ c
- RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1/ h/ l0 y$ `! |0 ?7 D- {; {$ `
- RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%19 o! `8 B* G: |, V* K4 x% O$ l- ^! Q
- RewriteRule3 C& A6 V9 Q% Q# ?8 n) D
- ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ " w0 C9 q! N9 b
- forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1( z' ~5 ~$ _7 q7 T) ?
- RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
' l) E9 Z) k$ y- a - RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1- \) h- O! N% s' R' J
- RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1
! ]8 S9 j V, [4 d# R- y" b - RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1</font></font>
複製代碼 存檔後馬上生效) W& O: O) n; p* [
* y, I! ]; r6 H# F【Discuz 後台設定】 後台->全局->SEO設置->URL靜態化
# [8 M: b8 c: s# i
8 W. r6 p2 r( b5 _2 H$ d& R可以全選或依據網站需要勾選
# _1 j( ]1 A' ]0 I; Y. m5 c! t+ C/ K: r1 F, F; w% B& w' W2 g5 ^
|