砍敺 IT_man 2016-8-14 21:30 蝺刻摩
% C M0 |* Q p- `3 E. L$ z
8 V( W8 f* A9 E! ]; _寞鈭:
5 X" e+ W, l& ~+ j( { b) c1 p1 V( E寞銝雿輻.htaccess
4 R4 P& l, J: V1.蝬脩寧桅銋.htaccess(靘憒/home/test/public_html)
, w8 I; k2 Q% _3 ?1 J( Z( j- RewriteEngine On& B2 ^; s; W. J$ d+ m9 n
- RewriteBase /2 Y% e, y5 c$ q5 L
- ^7 U" n7 C* k; j& Y9 W+ p
- RewriteCond %{QUERY_STRING} ^(.*)$, p7 [% v. W$ a0 }( w3 \
- RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topicid=$1&%16 v+ y/ c+ t9 K" |3 N3 t% }2 O
- RewriteCond %{QUERY_STRING} ^(.*)$, X# B2 a+ G! H* \
- RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
7 q; y5 M2 T, Z$ J" {7 {/ r - RewriteCond %{QUERY_STRING} ^(.*)$% e- {% N% v# L" ]& m
- RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
, L$ h H4 s8 f9 H, [% e - RewriteCond %{QUERY_STRING} ^(.*)$, f4 }( f. W9 k1 [. g% u
- RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
/ T& O e3 \2 w/ | - RewriteCond %{QUERY_STRING} ^(.*)$2 b8 U9 S+ k' |4 v9 I
- RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1. ~% l3 {4 ~: j) A |) V
- RewriteCond %{QUERY_STRING} ^(.*)$" W8 f" \* [" `* W1 y& W8 ]
- RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%16 g7 L" A# l% b* |% O. X( i; p9 F
- RewriteCond %{QUERY_STRING} ^(.*)$
& M; G, h3 ^" W4 T* T- s - RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1
" p' p, z; @! X; Q* Q. C4 G - RewriteCond %{QUERY_STRING} ^(.*)$
" G7 K2 g: `* B( O& I - RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1
) J3 ^5 t: X$ U9 q* Z1 O
銴鋆賭誨蝣 2.Discuz3.2隢憯敺->典->SEO閮剔蔭->URL->暸豢 , 蝡喟
) w1 x: }& A- F4 g h/ f寞鈭雿輻杗pacherewrite(mod_rewrite)閮剖
9 {& u. P% H# i2 Y/ I( K1./etc/httpd/conf/httpd.conf找<VirtualHost *:80>抒<Directory "/home/domain/public_html">,( x6 m# _8 o1 O6 ?- x
/etc/httpd/conf.d/砌蜓璈閮剖瑼憒virtual.conf找<VirtualHost *:80>抒<Directory "/home/domain/public_html">9 Z+ T) n( I- z# u/ |
憓隞乩批捆:
& v5 M/ [5 ?6 W( }# P/ @! {: S! D' b$ F, F7 N7 L
- RewriteEngine On5 ?/ p' M# ?; p' m6 D# R3 Z& C1 J. K' k
- RewriteCond %{QUERY_STRING} ^(.*)$" `. n1 I' f8 D. p: @# J( x
- RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topicid=$1&%1
+ F- I# y% M% g# k: K3 Z3 C: O - RewriteCond %{QUERY_STRING} ^(.*)$7 @/ q9 E9 H. H7 R
- RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%17 O: @; \' n* e$ T$ v$ L
- RewriteCond %{QUERY_STRING} ^(.*)$
. ^& V7 i+ Y4 \ - RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
6 `$ l; y+ ?/ r5 R: g. _ - RewriteCond %{QUERY_STRING} ^(.*)$
0 B' p2 t& N; y+ o* n$ Y: c' i* G - RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1" `- P) n7 v; s1 p* ~) R
- RewriteCond %{QUERY_STRING} ^(.*)$( _9 Z5 t8 m; y0 G# O
- RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%14 P; t4 q5 }" F) r: p
- RewriteCond %{QUERY_STRING} ^(.*)$
- @2 B+ Y% e& W3 n7 I - RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
1 ?9 O* j. U# X3 r9 X- {" E - RewriteCond %{QUERY_STRING} ^(.*)$8 J2 @6 j6 {1 E a7 O9 d ~+ N* P
- RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1& d2 G( s5 r& {
- RewriteCond %{QUERY_STRING} ^(.*)$
* h/ D& Q' h3 S/ K, F) F9 k - RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1
, u/ {7 s3 b% `0 [4 j
銴鋆賭誨蝣 2./etc/httpd/conf/httpd.conf折
* I4 [% t! o" l, PLoadModule rewrite_module modules/mod_rewrite.so 銝銵
1 `1 ?" ?- \4 r7 N3 F' `6 d嗅 httpd ==> service httpd restart
/ `% z E) N! P5 Q. a+ h
8 d$ Q1 ? c, Q& i5 E! _# F' f) w% |9 K! ^& T. \5 E/ B" B
|
|