砍敺 IT_man 2016-8-14 21:30 蝺刻摩 , i. M9 ~' L3 |- b
U- S; H! ]9 Y0 x o% [寞鈭:% E5 b3 k2 |9 ?" C
寞銝雿輻.htaccess
: I0 ^2 Z! n5 z1.蝬脩寧桅銋.htaccess(靘憒/home/test/public_html)" ]2 z y6 y9 M/ [" J8 V b& w% @
- RewriteEngine On# a1 K# W# _& P; v
- RewriteBase /
* W1 Y. h# X' d6 L7 ?, r
8 D8 X d4 B2 C- RewriteCond %{QUERY_STRING} ^(.*)$7 @& H8 L/ @( {5 q. T
- RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topicid=$1&%1
+ F" b/ C0 }$ j( a7 ^ - RewriteCond %{QUERY_STRING} ^(.*)$
% w2 t4 O. [1 b- r/ g - RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
$ g- I7 g4 O, ?9 s! _4 c# Q2 m - RewriteCond %{QUERY_STRING} ^(.*)$
$ G8 a& f' T8 o; x1 n/ R - RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
7 u3 Q+ z: U; F: j/ S - RewriteCond %{QUERY_STRING} ^(.*)$
4 ~' u3 n( v% g k( E - RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1( A- ~* @. T2 a+ y3 S
- RewriteCond %{QUERY_STRING} ^(.*)$
/ n' U" D$ S2 N# Z) M - RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1* ] z) U3 w3 X0 [& V
- RewriteCond %{QUERY_STRING} ^(.*)$
8 ]& R& D/ F- u/ R; M - RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
2 W# n8 m% Y9 y9 L - RewriteCond %{QUERY_STRING} ^(.*)$
8 z- q$ U [" _- Y - RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1: a' E4 m U0 R
- RewriteCond %{QUERY_STRING} ^(.*)$
2 s% M8 R! }$ D) W! y - RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1
! C$ f q. z/ V2 W! y
銴鋆賭誨蝣 2.Discuz3.2隢憯敺->典->SEO閮剔蔭->URL->暸豢 , 蝡喟& c: S: e, {2 J$ I
寞鈭雿輻杗pacherewrite(mod_rewrite)閮剖
, L- ^8 G) f: h4 I1./etc/httpd/conf/httpd.conf找<VirtualHost *:80>抒<Directory "/home/domain/public_html">,7 K0 Y$ K$ T0 V, w# ]
/etc/httpd/conf.d/砌蜓璈閮剖瑼憒virtual.conf找<VirtualHost *:80>抒<Directory "/home/domain/public_html">; r# F; F2 f U: F7 j
憓隞乩批捆:
6 x* g# h. `. B) {6 X1 g" L
7 ~" i/ ~0 K' R7 }; H( e- RewriteEngine On' R4 U3 R( c( p
- RewriteCond %{QUERY_STRING} ^(.*)$; m9 z) ~, [2 Y& y& @1 m
- RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topicid=$1&%1. z; P" ]) U+ K, f: |' y s: o2 o
- RewriteCond %{QUERY_STRING} ^(.*)$6 N8 \% x" r! @9 ?4 `! x$ ?5 R: @
- RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
. t( l& ~) k. o5 X6 G - RewriteCond %{QUERY_STRING} ^(.*)$ M8 @! Q4 C' C
- RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
5 q) A1 p* z1 [ I: d7 F - RewriteCond %{QUERY_STRING} ^(.*)$
* p+ W3 l5 q. l- D! g - RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1' U' L8 V S' i( l
- RewriteCond %{QUERY_STRING} ^(.*)$4 G, N0 M9 X1 j$ D7 z0 F1 Q
- RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%11 M. e6 J0 F* d+ Y
- RewriteCond %{QUERY_STRING} ^(.*)$
2 p3 c% r9 _4 Q- u9 j7 G+ H, w - RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
' O8 Y+ }) m Z) r2 r0 C |9 t; ` - RewriteCond %{QUERY_STRING} ^(.*)$
% c' z: o/ v5 c - RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1! b; \% u6 u( B! T+ p# W
- RewriteCond %{QUERY_STRING} ^(.*)$
0 A4 J! p4 q: c/ y; E7 ` - RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1
) b1 j% o4 M1 w- H9 ~" h P
銴鋆賭誨蝣 2./etc/httpd/conf/httpd.conf折9 v% r8 T& V) f: N3 }
LoadModule rewrite_module modules/mod_rewrite.so 銝銵5 l9 R7 ?2 y6 t; o
嗅 httpd ==> service httpd restart. B/ h- Y. |$ p7 m& U
# |4 w3 d* @3 i, r9 ~+ G+ N' d' K
' F$ V9 u/ @; ]! X$ t
|
|