砍敺 IT_man 2016-8-14 21:30 蝺刻摩
% z9 l; I5 y4 M. |- r- ]5 g
/ T3 z9 r# v) R2 S& c7 U寞鈭: B8 }% c$ s% w
寞銝雿輻.htaccess
$ c0 \9 U/ f) r9 C3 {- c+ R1.蝬脩寧桅銋.htaccess(靘憒/home/test/public_html)- P( o4 ^" I& u2 m4 K, r
- RewriteEngine On; E. B* t( `4 O8 F5 i8 G q
- RewriteBase /
# t0 T# X8 c2 M- z! ~2 w! A - $ X& a7 p1 E7 W, ~: h) {
- RewriteCond %{QUERY_STRING} ^(.*)$
8 w2 ^# _0 h- E2 o( [2 { k/ x - RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topicid=$1&%1
/ i5 J) J( T! d q3 l - RewriteCond %{QUERY_STRING} ^(.*)$3 `7 I+ F/ m7 C1 u; j. j7 J( O
- RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
0 f) w: B' g( ]5 X" r5 } - RewriteCond %{QUERY_STRING} ^(.*)$7 H/ P. A3 J( z: [7 x
- RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
+ q5 Q% K' B9 |' k: o" y - RewriteCond %{QUERY_STRING} ^(.*)$
3 V0 c x8 S7 |4 W4 E% M% S0 N - RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1, `5 a. U: B( s
- RewriteCond %{QUERY_STRING} ^(.*)$, r$ v; v+ N. L3 A9 q
- RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
$ K0 j' x1 b2 Q3 t - RewriteCond %{QUERY_STRING} ^(.*)$# J$ |7 K5 B1 V6 e8 g
- RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
4 |" a, e& S- h! i1 E - RewriteCond %{QUERY_STRING} ^(.*)$$ k: H! n$ D" ] B# U
- RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1! Q* _8 o# l% R( ^
- RewriteCond %{QUERY_STRING} ^(.*)$! w/ I2 [, o# g+ ^" M+ Z) x0 E3 Y
- RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1( ]" S5 S0 v. Q1 [% _- h& t& N
銴鋆賭誨蝣 2.Discuz3.2隢憯敺->典->SEO閮剔蔭->URL->暸豢 , 蝡喟
1 ]: I8 y9 y' E# J ]寞鈭雿輻杗pacherewrite(mod_rewrite)閮剖/ `' E7 E( S% l$ B0 V- A
1./etc/httpd/conf/httpd.conf找<VirtualHost *:80>抒<Directory "/home/domain/public_html">,; Q, I( V! `7 Y: Q' N; Y
/etc/httpd/conf.d/砌蜓璈閮剖瑼憒virtual.conf找<VirtualHost *:80>抒<Directory "/home/domain/public_html">, v! }/ V$ ?5 _/ Y
憓隞乩批捆:
\8 c8 i9 K! f8 D. l) D* I! k! Z& v- i0 B; J: { C6 ~. K
- RewriteEngine On/ w# o+ x9 r( g0 b
- RewriteCond %{QUERY_STRING} ^(.*)$
" i" {0 G/ H3 N, G2 D- j4 W - RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topicid=$1&%1; \9 `4 H7 I2 F; k% S8 E' i
- RewriteCond %{QUERY_STRING} ^(.*)$8 c. l/ r1 @: p3 L9 X8 J8 L" ]* w! L
- RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
/ T# W' y) ^% z- @4 r - RewriteCond %{QUERY_STRING} ^(.*)$
, B2 j, P0 y8 u# S# K6 g - RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1% C) N p( a( d7 Z2 H( J2 X/ L4 ?
- RewriteCond %{QUERY_STRING} ^(.*)$
! t/ o8 J2 x1 k, H+ y/ w4 c - RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
7 ?; r" \1 [) S1 ] a6 { - RewriteCond %{QUERY_STRING} ^(.*)$
3 j0 C* r9 D+ C( C - RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
9 H" @9 f1 p6 a R5 D3 J# ^; i' p8 _ - RewriteCond %{QUERY_STRING} ^(.*)$6 u2 N" g2 c1 c K; ^ T) H
- RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1) f% U- P3 P; T/ R( Y8 u
- RewriteCond %{QUERY_STRING} ^(.*)$. b0 ]$ J5 C9 \& v) l5 ?
- RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%13 u4 u! K# g" S# G$ Z2 }
- RewriteCond %{QUERY_STRING} ^(.*)$7 @5 k4 t; V! Y+ A* r; @
- RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1
# g7 m0 N" c. v: G5 @
銴鋆賭誨蝣 2./etc/httpd/conf/httpd.conf折% |. ]: u8 `: b+ H9 p0 o' J" x
LoadModule rewrite_module modules/mod_rewrite.so 銝銵7 Y# @2 D X7 k
嗅 httpd ==> service httpd restart
. d% A D' _( z9 t; @2 a
0 `, M' T" j2 b; u' g0 t
, u: f7 ~& y0 f* X% G |
|