砍敺 IT_man 2016-8-14 21:30 蝺刻摩
2 q) H3 i, V) l7 [5 q+ D6 k# Z4 K+ C8 t" i# ]' M6 l6 x
寞鈭:
3 t5 {6 ~5 A7 w寞銝雿輻.htaccess
9 l! o5 o6 g. j- ]6 F1.蝬脩寧桅銋.htaccess(靘憒/home/test/public_html)) Q2 x( ^( X/ U# s/ g
- RewriteEngine On! w. g! s: p3 d8 s) y& H
- RewriteBase / |" }6 B) S5 O- C7 C
- 4 o; D1 e5 Y, _9 K/ l
- RewriteCond %{QUERY_STRING} ^(.*)$% y( e5 E, x! X5 a0 b
- RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topicid=$1&%1# m! w% f' r/ N6 D l
- RewriteCond %{QUERY_STRING} ^(.*)$
_" d: {4 y/ B- j - RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1$ `' b8 ~: Y! B! D6 t% I0 e/ {
- RewriteCond %{QUERY_STRING} ^(.*)$
% ]3 l7 {# `) ? F4 V: J - RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
, P$ V! O3 v$ p - RewriteCond %{QUERY_STRING} ^(.*)$% a9 L; p5 ~: n6 ~
- RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
6 Q4 F$ L9 T+ H* s, C - RewriteCond %{QUERY_STRING} ^(.*)$2 K4 E+ I8 H* @6 C8 C
- RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
" O" t' O" J& \! l2 Q7 k - RewriteCond %{QUERY_STRING} ^(.*)$
* \; D! ?4 y T$ ^# \/ T - RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1" s. M3 p8 J$ r0 b# D
- RewriteCond %{QUERY_STRING} ^(.*)$% N- A K5 c6 M1 _- |* Y# k3 _
- RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1' x1 T" h1 p' h& H5 A. |9 [
- RewriteCond %{QUERY_STRING} ^(.*)$
) s6 r5 g) A4 X3 c6 _( z - RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1
1 R1 H8 C% u! x% A8 U5 G, Y% w
銴鋆賭誨蝣 2.Discuz3.2隢憯敺->典->SEO閮剔蔭->URL->暸豢 , 蝡喟; _9 u0 j( K# V0 N" g: K! U, i/ a2 A
寞鈭雿輻杗pacherewrite(mod_rewrite)閮剖
8 b% d6 g& ?( S+ |) ~0 o5 u2 m' }1./etc/httpd/conf/httpd.conf找<VirtualHost *:80>抒<Directory "/home/domain/public_html">, E2 Z0 X$ Y3 b4 w+ O* k: q
/etc/httpd/conf.d/砌蜓璈閮剖瑼憒virtual.conf找<VirtualHost *:80>抒<Directory "/home/domain/public_html">
6 h/ m8 U1 F) q! Z/ @( J憓隞乩批捆:& l. a" U4 Q5 A5 K
* n& ^5 u# X3 E2 Z7 p
- RewriteEngine On2 r6 Y; n- X1 t" d! V* S
- RewriteCond %{QUERY_STRING} ^(.*)$
3 i' Z8 h* u. k! l! y2 T. ]( G: g+ C - RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topicid=$1&%1
" p* g3 _. [% q, a( x - RewriteCond %{QUERY_STRING} ^(.*)$
8 d( q, q8 ^; R$ j `1 a9 P- t) X& F - RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
$ ^( r* j4 S; l. i - RewriteCond %{QUERY_STRING} ^(.*)$
' v5 z: W g' e: j" s( [5 |: e - RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
9 a2 T1 n4 N+ y1 ]' l! f - RewriteCond %{QUERY_STRING} ^(.*)$ H5 x& Q8 L5 b4 \8 j
- RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1- m& a2 w# B! A4 D7 s* M2 G. [
- RewriteCond %{QUERY_STRING} ^(.*)$
( g M" C' M) [6 S. s - RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%17 R! x! ?( b4 }5 b! ]
- RewriteCond %{QUERY_STRING} ^(.*)$% \* Y% v# i% u2 p
- RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
" R4 j4 i5 `9 T" }6 Y - RewriteCond %{QUERY_STRING} ^(.*)$
o6 G! z0 ?( ]6 G - RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1+ S2 ~$ S$ ]$ o
- RewriteCond %{QUERY_STRING} ^(.*)$
& N$ K3 M5 t- H \7 w& u2 { - RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1
, \1 {+ s' e- B( ~2 @( ~6 v
銴鋆賭誨蝣 2./etc/httpd/conf/httpd.conf折
( j: q) c% i( a0 P1 _' d$ @1 zLoadModule rewrite_module modules/mod_rewrite.so 銝銵7 A! v* b3 J+ a. J% D0 z
嗅 httpd ==> service httpd restart( r Y2 w' N; Q
: l) d7 [6 D) {/ P( `
- W8 I. }' o4 B& _: L0 ]) {1 B |
|