砍敺 IT_man 2016-8-14 21:30 蝺刻摩 # I( E t9 ~6 i0 Q2 [ @
( \1 N! v' R/ M; x. ?; M: D寞鈭:$ G( M/ Z3 P6 C0 z7 \
寞銝雿輻.htaccess
; h! R v- t6 J" w/ L2 A1.蝬脩寧桅銋.htaccess(靘憒/home/test/public_html)2 \4 p3 u4 c; q
- RewriteEngine On) A! G8 v2 r& _6 J' d6 C' ^
- RewriteBase /2 q6 J# r) e- J* r! H
% y$ ~1 m" @ c4 S- RewriteCond %{QUERY_STRING} ^(.*)$
# m0 L2 e( T# [5 w) w - RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topicid=$1&%1
+ }1 V5 d# N! f1 g - RewriteCond %{QUERY_STRING} ^(.*)$
9 i5 u% N: ], V. x% U - RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
& F, w& A. U7 ?8 d5 J0 O - RewriteCond %{QUERY_STRING} ^(.*)$6 Z2 f3 Q f- ?" z
- RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
! T4 N8 R0 S; X3 g* ` - RewriteCond %{QUERY_STRING} ^(.*)$
2 g: c, [' B) J' r# R! [ - RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1% o# |+ v* I# J; P
- RewriteCond %{QUERY_STRING} ^(.*)$( `6 ^; d9 I% J' Y! ^# x5 A
- RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
* }7 j) R$ J5 B" T7 D+ @# I) Z7 V - RewriteCond %{QUERY_STRING} ^(.*)$2 n3 x" @9 D% |1 T a
- RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
6 t+ }2 Z1 `3 { - RewriteCond %{QUERY_STRING} ^(.*)$
* |. J( p6 \0 f0 B( u# E' C - RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1 g. f$ |9 Y8 }5 G
- RewriteCond %{QUERY_STRING} ^(.*)$
, g, z7 W! E# Z! m/ B - RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1- n8 L" ~6 s5 x. x3 m1 m
銴鋆賭誨蝣 2.Discuz3.2隢憯敺->典->SEO閮剔蔭->URL->暸豢 , 蝡喟. u' c1 Q8 c, O
寞鈭雿輻杗pacherewrite(mod_rewrite)閮剖 b4 P. G8 n& X5 R L
1./etc/httpd/conf/httpd.conf找<VirtualHost *:80>抒<Directory "/home/domain/public_html">,) i8 F% e# q8 B4 F
/etc/httpd/conf.d/砌蜓璈閮剖瑼憒virtual.conf找<VirtualHost *:80>抒<Directory "/home/domain/public_html">
7 @. h& c0 I8 d. Q9 V憓隞乩批捆:
7 b6 X3 l3 m* @- O$ s! T
; Z" b/ \) f6 l6 ~9 ?- RewriteEngine On1 e0 t% m1 A$ D# A
- RewriteCond %{QUERY_STRING} ^(.*)$
) t: s2 O) J1 u) c( ?2 z1 K - RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topicid=$1&%1' O* B8 ]4 A% w6 e
- RewriteCond %{QUERY_STRING} ^(.*)$7 S+ H3 _( F1 Z3 ~' a% s
- RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%10 b b. W3 W% Q) l- |; J# Z3 |" C
- RewriteCond %{QUERY_STRING} ^(.*)$
+ n! P$ E. B: v - RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%14 @ m( ]" ^' ?7 s B
- RewriteCond %{QUERY_STRING} ^(.*)$3 c$ G: Y7 K4 f4 q. k
- RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
. D( s6 a' M' [7 a- f* I - RewriteCond %{QUERY_STRING} ^(.*)$
8 l. s7 b2 z& a- F! D# c2 j - RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
7 ~+ r y( J+ ^ - RewriteCond %{QUERY_STRING} ^(.*)$" x$ ?8 r# _4 v/ w/ M
- RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1, ]/ k6 _, c5 u$ Q* j, X4 M; p; G
- RewriteCond %{QUERY_STRING} ^(.*)$
. g- G, y" o8 z1 P - RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1
2 } z: \7 r+ e2 l/ J - RewriteCond %{QUERY_STRING} ^(.*)$9 D5 o0 g4 f7 D4 F9 g0 u
- RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%15 s2 |# B% p& d: J
銴鋆賭誨蝣 2./etc/httpd/conf/httpd.conf折9 M' O2 r! c( d# M
LoadModule rewrite_module modules/mod_rewrite.so 銝銵$ M' Y: h+ C! s! W+ D0 g7 A
嗅 httpd ==> service httpd restart
! A) L' F& A# ^/ k3 {' r& o" [% R+ ~( H+ z- Y% x& H, Y
" {" D$ E4 \7 T V, F |
|