砍敺 IT_man 2016-8-14 21:30 蝺刻摩
8 E' V# I$ y: V: k. [0 A' R( ], h3 K- f+ U/ }
寞鈭:
) R D. B! s/ X* b. X) a% p2 f r寞銝雿輻.htaccess
9 O- G8 S+ x2 `/ d1.蝬脩寧桅銋.htaccess(靘憒/home/test/public_html)* O2 |6 V" n; h* X1 h
- RewriteEngine On
3 f) I, i5 a$ j- F - RewriteBase /" f& g( T: ~' i& b: g1 V# G! i
- * a; O. k2 d/ g! d, A
- RewriteCond %{QUERY_STRING} ^(.*)$
* F( z4 Q$ O' U4 Q - RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topicid=$1&%1* T, w7 |& j- C# W
- RewriteCond %{QUERY_STRING} ^(.*)$3 G" l" C! W; _& g7 I' Y3 O! E
- RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
1 x3 x$ S7 R" Q4 K8 D0 K# v7 ~7 Z - RewriteCond %{QUERY_STRING} ^(.*)$3 o8 L% Y2 J: ~; p
- RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%16 w/ |5 _% Q; }4 \/ J R6 E7 _
- RewriteCond %{QUERY_STRING} ^(.*)$
; @7 i& I7 \$ H) ]2 T - RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
. W) x2 @) J- q7 l, [3 _3 }- t - RewriteCond %{QUERY_STRING} ^(.*)$4 H' X; g) e8 B3 R/ ]
- RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
, [: f5 [# B6 w+ E0 {3 w - RewriteCond %{QUERY_STRING} ^(.*)$
* p# m# Y( w5 w, ~% c3 _3 d - RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%15 G/ n1 K: B% Y( N5 |9 s# O0 `
- RewriteCond %{QUERY_STRING} ^(.*)$7 v% y7 V1 P: k, i4 h, J" C8 o
- RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%14 m5 _" k$ y3 o1 \
- RewriteCond %{QUERY_STRING} ^(.*)$
- N! t2 v: C/ L- F; i - RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1% w3 g8 V# |7 B- b# {1 N [# a
銴鋆賭誨蝣 2.Discuz3.2隢憯敺->典->SEO閮剔蔭->URL->暸豢 , 蝡喟
1 w: a' C4 |" a9 W6 B寞鈭雿輻杗pacherewrite(mod_rewrite)閮剖! Y" }1 G/ ?6 J0 p! s+ J" ]$ H
1./etc/httpd/conf/httpd.conf找<VirtualHost *:80>抒<Directory "/home/domain/public_html">,! t) @" g% N' m" A- `7 ?" m
/etc/httpd/conf.d/砌蜓璈閮剖瑼憒virtual.conf找<VirtualHost *:80>抒<Directory "/home/domain/public_html">
% i2 k( U3 }; I+ d憓隞乩批捆:
6 L8 d; Y) b3 D7 g% t( {
S( K* m7 y& o- RewriteEngine On; t" Y; W6 \* G0 l
- RewriteCond %{QUERY_STRING} ^(.*)$
6 l- Z0 a b+ I3 V$ q, x - RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topicid=$1&%14 Y! k6 Z/ J( d% e5 A; \
- RewriteCond %{QUERY_STRING} ^(.*)$
- ?+ q" E+ X- X g: |! J. C' T# I - RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
( }& g0 w; ?3 s8 T' ]1 h+ ~ - RewriteCond %{QUERY_STRING} ^(.*)$
" q" V2 }4 {' m1 N - RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
% Y. @" W$ v+ L5 @, D5 h- S3 b - RewriteCond %{QUERY_STRING} ^(.*)$9 E- U# J ]9 _& z# Z" ?# ?
- RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
5 p0 ^4 W$ q4 c7 ^% d# X9 a7 A4 { - RewriteCond %{QUERY_STRING} ^(.*)$1 y. D% | |/ G! r: r1 ^' T
- RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1/ Q* Q }+ A# `! u2 s
- RewriteCond %{QUERY_STRING} ^(.*)$
# }% X* ?& f' J5 b$ Q K0 i) { - RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%19 Q1 {- S) m+ e4 X& @
- RewriteCond %{QUERY_STRING} ^(.*)$
% x+ P! e% Q2 l' U' m$ X - RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1
- L) Z U' M& k# r1 ~3 l/ h - RewriteCond %{QUERY_STRING} ^(.*)$
- B2 ^ _% T! [# _) G2 s9 W0 y - RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1, ~$ `+ g& R- c M: {' }/ G# v5 h
銴鋆賭誨蝣 2./etc/httpd/conf/httpd.conf折* J6 b0 i5 G5 V3 ], p
LoadModule rewrite_module modules/mod_rewrite.so 銝銵
! I J* J$ j6 U' S* |' A嗅 httpd ==> service httpd restart
9 U. q8 P2 R4 w5 P( q& Q
/ S" ]1 x+ M3 G; X9 ?( V. h4 S0 s! M& r. n" s
|
|