砍敺 IT_man 2016-8-14 21:30 蝺刻摩
( ?' \- s: |! U ~' @. O m$ s. E V9 v$ X6 j" K
寞鈭:
7 C+ M% P. n8 X# s寞銝雿輻.htaccess
: H) W( P# P* G, P% F+ ?1.蝬脩寧桅銋.htaccess(靘憒/home/test/public_html)
8 B! c K! n b5 @) L) K! O- RewriteEngine On4 i( T; G4 C' ]) x- b2 y4 M; v
- RewriteBase /
9 y3 k$ _8 w9 m1 z - 5 H( B4 n. ~3 J3 J) y q% v
- RewriteCond %{QUERY_STRING} ^(.*)$' f, R6 Y; o0 g3 ~, n. `6 H
- RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topicid=$1&%1( i0 {' g7 b2 F' v, J" i7 Q: I
- RewriteCond %{QUERY_STRING} ^(.*)$3 g. x4 H4 [, d1 B& d+ A$ X/ M
- RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
2 W( w0 f4 X1 C% L5 v, G6 f - RewriteCond %{QUERY_STRING} ^(.*)$
2 z( V3 s; t2 S5 w7 [0 | m - RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1/ L' k1 T, q* l9 f; O- Q; h: ?
- RewriteCond %{QUERY_STRING} ^(.*)$& M' u v1 [7 ^( t x" U
- RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
- r9 n' |# n( N" L( ]% l% b) m8 q - RewriteCond %{QUERY_STRING} ^(.*)$
- N/ u7 O3 {! I7 w" |/ M - RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
3 _% E; c$ Z6 _5 H& y& j - RewriteCond %{QUERY_STRING} ^(.*)$; T) X p3 {" `2 }0 k7 c# E
- RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
# R* P* y; U. x9 m3 m/ d - RewriteCond %{QUERY_STRING} ^(.*)$( ?7 j$ o o2 F3 v8 }
- RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1
4 G7 y) N C) T% Y$ v - RewriteCond %{QUERY_STRING} ^(.*)$/ r" b6 f' d( d8 |) ?" f
- RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1
' K) w$ j# |1 F- w; N+ |* k
銴鋆賭誨蝣 2.Discuz3.2隢憯敺->典->SEO閮剔蔭->URL->暸豢 , 蝡喟, z) i* C/ Q- p9 A6 [
寞鈭雿輻杗pacherewrite(mod_rewrite)閮剖
+ z D2 ^, u' }6 \$ p1./etc/httpd/conf/httpd.conf找<VirtualHost *:80>抒<Directory "/home/domain/public_html">,
& D- E; o4 i: I7 e/etc/httpd/conf.d/砌蜓璈閮剖瑼憒virtual.conf找<VirtualHost *:80>抒<Directory "/home/domain/public_html">
K* I& n$ H, \3 }) X& S0 K憓隞乩批捆:7 x' B* a, J5 f9 z
0 j! R7 }# n5 [3 G- RewriteEngine On
4 b4 O* O+ g$ g3 d t - RewriteCond %{QUERY_STRING} ^(.*)$0 I/ Q' X+ n" ^0 \5 ^
- RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topicid=$1&%1
# D+ D( p0 @ F - RewriteCond %{QUERY_STRING} ^(.*)$
! Y) y- a' F) ^8 Z" X' B0 C0 b - RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1% X5 ], p1 z! f# M2 ~0 t
- RewriteCond %{QUERY_STRING} ^(.*)$
% s, B8 R) b7 p - RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1 l g0 I/ @$ M* r% V
- RewriteCond %{QUERY_STRING} ^(.*)$6 I% }# S# u6 W: c# J
- RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%10 B/ S# z1 [$ F' U
- RewriteCond %{QUERY_STRING} ^(.*)$5 f/ X" Q% e# g) W$ g8 S
- RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
" D, X1 q6 p1 G: s. {3 v - RewriteCond %{QUERY_STRING} ^(.*)$+ o( T$ R5 y* b# H
- RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1, i' V( a, u0 r
- RewriteCond %{QUERY_STRING} ^(.*)$
( |$ V- ~ d/ u( Y! M+ h - RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1) _6 z7 k. ]4 A8 V! [7 r
- RewriteCond %{QUERY_STRING} ^(.*)$
3 @1 F5 Z' O; G: { c, Y* G - RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%18 `. ?6 Z" L! i' u6 T
銴鋆賭誨蝣 2./etc/httpd/conf/httpd.conf折4 V/ ^0 h, ?6 t2 ^+ T7 k
LoadModule rewrite_module modules/mod_rewrite.so 銝銵0 D) O: |" A8 A, r, N3 d
嗅 httpd ==> service httpd restart
- S4 D( B3 A. o4 q4 o# @6 X$ w4 i% b B+ ^3 i4 @) l |
7 @) b9 v% A( D% f! f7 ?
|
|