砍敺 IT_man 2016-8-14 21:30 蝺刻摩 4 ^0 D5 f: {# ^
, M9 V2 X( j5 G+ e6 C$ ]; E寞鈭:* ]% l7 F3 D5 f% w
寞銝雿輻.htaccess' q# v+ }# V" G9 j. x! D8 X
1.蝬脩寧桅銋.htaccess(靘憒/home/test/public_html)" T- d% l; D5 i$ r# ^8 _* t$ ]) ~
- RewriteEngine On2 W/ \& a7 a0 q9 H* a/ }
- RewriteBase /
4 m) d. [/ p. C. o' z
9 i+ H* u% Q$ O8 [" Y- RewriteCond %{QUERY_STRING} ^(.*)$
* d+ N2 R: G" V- X+ J a - RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topicid=$1&%1
9 z5 L8 D5 v- ^ - RewriteCond %{QUERY_STRING} ^(.*)$
+ U' ]) h) \. v2 f6 H4 k - RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
) _( L8 S, {6 F - RewriteCond %{QUERY_STRING} ^(.*)$( @/ h6 {& Q1 U
- RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1; w, i I( t$ R* t% b9 y1 y w
- RewriteCond %{QUERY_STRING} ^(.*)$
/ O! L9 ^/ H( P7 h - RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
! y2 D) G% L4 f) \/ Q7 N4 d; Z8 V% ^* H - RewriteCond %{QUERY_STRING} ^(.*)$" f4 k7 i; Z& T$ e1 {3 G& _9 j
- RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
- j; l) j1 @) u7 ^ - RewriteCond %{QUERY_STRING} ^(.*)$
- p# K, m' W( P5 G: h1 a - RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%12 F# f1 S8 V* w3 F9 G3 @& N) T" D
- RewriteCond %{QUERY_STRING} ^(.*)$; k, v# V0 _# |# `% A5 R7 n
- RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%19 O9 X2 e, |& V! e! ]
- RewriteCond %{QUERY_STRING} ^(.*)$& g& [2 R" V$ Q* x
- RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1 `* h/ S1 h/ t/ K# S: G
銴鋆賭誨蝣 2.Discuz3.2隢憯敺->典->SEO閮剔蔭->URL->暸豢 , 蝡喟
& F; Y) B$ F% t2 g. r$ O$ Y寞鈭雿輻杗pacherewrite(mod_rewrite)閮剖
. V ^, \9 E E3 @" ~% |9 s1./etc/httpd/conf/httpd.conf找<VirtualHost *:80>抒<Directory "/home/domain/public_html">,
) e* @. f' ]0 V+ w( c4 m/etc/httpd/conf.d/砌蜓璈閮剖瑼憒virtual.conf找<VirtualHost *:80>抒<Directory "/home/domain/public_html">
: C. N- \# c* g" P" c: l憓隞乩批捆:
, F( \ u! ?1 a9 O' g; w
9 N/ p% T% y6 x) F% U- RewriteEngine On) ^) e5 [- l+ m1 \+ @9 ?% x% \$ S/ _
- RewriteCond %{QUERY_STRING} ^(.*)$
4 B! P, A+ E/ k( o - RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topicid=$1&%1
: R! o( t6 ~7 D4 M* E9 c - RewriteCond %{QUERY_STRING} ^(.*)$5 `) W8 O) J* C/ f" m
- RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%13 [1 p/ @: m' S, E2 D/ G {
- RewriteCond %{QUERY_STRING} ^(.*)$
6 R, O, ~1 t! e# F1 p; Q/ I: w# L - RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%13 m. T4 Q( Z, J5 M7 Q( h
- RewriteCond %{QUERY_STRING} ^(.*)$# |9 w3 C( x$ F# H; N/ C
- RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1" Z% ], P, }9 h9 m( `) N! L; u
- RewriteCond %{QUERY_STRING} ^(.*)$
- K3 e8 P6 v2 V7 ` - RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
3 p- A3 d1 E4 S' Q2 J0 n - RewriteCond %{QUERY_STRING} ^(.*)$& A# p6 C" ?$ K9 P, W9 o1 U+ T! \
- RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
3 g8 z( I+ Y! g6 C - RewriteCond %{QUERY_STRING} ^(.*)$# Y6 b. {, Q; {+ l
- RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1
5 K4 c3 r$ C% r: \4 P) c( D+ ^ - RewriteCond %{QUERY_STRING} ^(.*)$
q# Q' N1 Y5 q S2 |! I" S5 w - RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1
4 T, p2 N2 J2 w% l
銴鋆賭誨蝣 2./etc/httpd/conf/httpd.conf折1 N% K4 k/ M5 V( u3 C+ f
LoadModule rewrite_module modules/mod_rewrite.so 銝銵
- ]/ m9 ^" Y, R- K嗅 httpd ==> service httpd restart- v6 z V- _7 Q5 b# u1 G
$ O, V% [( Q& z1 C% J
) Q& w/ y4 s/ |6 h( e |
|