tid=193& 本帖最後由 IT_man 於 2014-12-25 11:19 編輯 , Z6 f3 J8 T& W0 W% G
: Q p3 c3 e: d' I7 ^0 T N2 ~
在此分為「Host server設定」及「Discuz 後台設定」6 S9 m+ L9 G4 \4 m2 _6 Y# q
【Host server設定】 又分為Web server及站台根目錄下的.htaccess
' U4 h3 p. S" V& B$ c: ~ Web server 註:有個地方須注意,/etc/httpd/conf/httpd.conf中<Directory "/www/coav4u/test"> 的 AllowOverride 一定要all,.htaccess才有作用
$ y9 L2 ~; q/ E4 y$ R; |
- Z: @ [% p/ H) Y6 {0 t 站台根目錄下的.htaccess- # -FrontPage-) d0 x& d! m3 t4 M& D
- IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
{2 Y& \4 p& e5 W. m, ? - # disable directory browsing
8 V+ m+ y1 b; D3 B4 }+ \3 ~ - Options All -Indexes
- U7 e9 B+ R2 Z9 |! t - RewriteEngine On # 將 RewriteEngine 模式打開+ M5 Z' Y! Y; S, [, ? ^
- RewriteBase / #設定為網站的根目錄; x8 I. {8 ~* \9 f4 A5 g! A4 @
- #
2 j/ s9 g6 r5 c/ d2 t - RewriteCond %{HTTP_HOST} ^av4u.info [NC]0 W: _! g S3 s# J
- RewriteRule ^(.*)$ HTTP://www.av4u.info/$1 [L]<font face="楷體,標楷體"><font size="3">RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1. D' ?; j5 @* a; U' P4 x7 T
- RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%10 P6 ?# O3 `& b7 j p: v
- RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
4 E4 E6 c" y2 `; o - RewriteRule
/ d# A6 W }9 ~' {' J - ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$
' o. @% x% e& J( C - forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
) h0 m4 i) K( W, G% D6 L - RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1 J+ w6 C/ X; |; w$ c" m
- RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
: h6 y0 N0 X$ p7 r( w6 y% W# O+ i9 ] - RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1
* @1 B: X0 ~4 T# D - RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1</font></font>
複製代碼 存檔後馬上生效
; Z- h9 H, L* Y
7 h y U0 r$ M8 r【Discuz 後台設定】 後台->全局->SEO設置->URL靜態化) Z3 G: z* O) Z4 c3 [
0 d' D. U: Z8 W7 x+ p- w- [" Y
可以全選或依據網站需要勾選! {/ {: L G% n
4 {7 T" U6 j" _ |