砍敺 IT_man 2016-8-14 21:30 蝺刻摩 ' S( [( }% t+ e6 x. X" S# o0 o/ Q1 R
2 ^6 O* W3 F8 z' M" H3 X9 S5 P寞鈭:* x% j. q% k7 ?' ~0 ^
寞銝雿輻.htaccess
0 R1 ^1 c: _0 Z! T7 d ], O1.蝬脩寧桅銋.htaccess(靘憒/home/test/public_html)% H |: C" l6 A) w) x
- RewriteEngine On. s2 L# s& [$ v/ J- z
- RewriteBase /$ B+ [: t% J- F s! e% S. b
- / \# m% f# y9 X9 \; S3 d$ J& t) L
- RewriteCond %{QUERY_STRING} ^(.*)$6 Q( R1 Y/ {5 Z t
- RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topicid=$1&%1! j! e) Q4 D* Y
- RewriteCond %{QUERY_STRING} ^(.*)$. T x$ u3 j- i0 |5 F! ^
- RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1% S! _/ Y8 E1 x; I6 F
- RewriteCond %{QUERY_STRING} ^(.*)$
0 e: y. V" a0 y# t Q" X1 p - RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1( H4 Y) M6 n4 D, S
- RewriteCond %{QUERY_STRING} ^(.*)$
w, I* r! a- _1 k - RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1, W4 D/ {( K/ o$ }
- RewriteCond %{QUERY_STRING} ^(.*)$
* ^# \9 w2 a4 p( |% {9 @ - RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
, S: p8 M, c% B! y, i; e4 Y4 l" o - RewriteCond %{QUERY_STRING} ^(.*)$
2 i' b( J4 l; M9 y+ V - RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
; W$ b3 i$ F# u( O& P - RewriteCond %{QUERY_STRING} ^(.*)$
5 y. Z2 z: {* }+ t8 ?& ~" N - RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%19 f9 u9 f- {) L( {" ?
- RewriteCond %{QUERY_STRING} ^(.*)$
* x3 V& G2 a& t; A9 S - RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1
$ N7 G1 I% M8 W, X
銴鋆賭誨蝣 2.Discuz3.2隢憯敺->典->SEO閮剔蔭->URL->暸豢 , 蝡喟
0 c* Q( V" z% T- z' a+ D寞鈭雿輻杗pacherewrite(mod_rewrite)閮剖# m v: n' o" q b
1./etc/httpd/conf/httpd.conf找<VirtualHost *:80>抒<Directory "/home/domain/public_html">,0 Z( K7 C' i2 W2 e
/etc/httpd/conf.d/砌蜓璈閮剖瑼憒virtual.conf找<VirtualHost *:80>抒<Directory "/home/domain/public_html">
5 |# e. ] G% r. |, R憓隞乩批捆:
& h) l7 T; h9 j2 S. E; r' {9 h) f1 a$ v
- RewriteEngine On3 L; t: s5 k7 |8 l4 M& j( S
- RewriteCond %{QUERY_STRING} ^(.*)$
( O6 I9 j& h/ I4 v+ f4 M - RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topicid=$1&%1
: \8 i- _! B1 Q, y. j1 L2 ?- y - RewriteCond %{QUERY_STRING} ^(.*)$
) G6 Q0 L& R# `" j2 L5 ^4 Y3 _% a - RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1( h6 S" `- H* \: ^ T1 z" R8 x* y+ Z
- RewriteCond %{QUERY_STRING} ^(.*)$2 n; k; H ~; `7 C: b1 }
- RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
0 U8 Y# n/ L# T - RewriteCond %{QUERY_STRING} ^(.*)$4 O+ f1 r' |) A( Y
- RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1! B$ o8 K! W" Y5 `* F$ q8 S
- RewriteCond %{QUERY_STRING} ^(.*)$9 n; k c/ M' d1 }
- RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1' j4 f. W# }2 l8 s
- RewriteCond %{QUERY_STRING} ^(.*)$ R8 G8 }" N5 L h, V7 i
- RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
2 s/ r0 o, V+ B* `( i( ]/ k5 O' Y - RewriteCond %{QUERY_STRING} ^(.*)$
4 m% K* C8 V8 m9 N8 K4 ~% U* e - RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1- r# f; d* X/ U$ w4 [
- RewriteCond %{QUERY_STRING} ^(.*)$
9 g" N" e/ t/ L+ k' J - RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1
, C+ e' ~9 U* s. H7 t( g2 K
銴鋆賭誨蝣 2./etc/httpd/conf/httpd.conf折+ c; J$ U7 F' R9 n, L# ~8 E* B
LoadModule rewrite_module modules/mod_rewrite.so 銝銵
6 m. q$ a4 U9 i! c, I嗅 httpd ==> service httpd restart
/ T7 g5 e0 S. a% R! Z4 V$ R9 ?( i# y6 v6 {9 q7 z
5 y: B) C7 J8 _$ I3 E7 E# w$ _
|
|