砍敺 IT_man 2016-8-14 21:30 蝺刻摩
* r' i5 u3 @; }0 n
# v1 M7 B6 {" Y% x# g9 `; ]- Q寞鈭:2 j. H5 A( S) r. b7 c
寞銝雿輻.htaccess
6 R: e3 j# L. b6 a* W1.蝬脩寧桅銋.htaccess(靘憒/home/test/public_html)7 t+ I& j' v7 Q6 w
- RewriteEngine On
: J) L3 w$ \$ P9 J% b - RewriteBase /' N7 i V1 w" Y9 ~9 S
1 t+ M" z' d+ ~8 f. N. E- RewriteCond %{QUERY_STRING} ^(.*)$
* {- u" Z! p- v6 B5 ^ - RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topicid=$1&%1) J5 T$ l% B& e: ]% s0 h" r6 L
- RewriteCond %{QUERY_STRING} ^(.*)$# F" F1 L3 _" G$ q' @7 q
- RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
' b8 }" a5 A2 B. u1 @* {+ E" Q* J$ | - RewriteCond %{QUERY_STRING} ^(.*)$
s" G8 a/ o. y - RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
9 m0 }+ R1 p9 X F - RewriteCond %{QUERY_STRING} ^(.*)$" {1 m1 _% R& c. y6 J* K
- RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1: u! X+ H0 I# G G+ r' C2 @- m
- RewriteCond %{QUERY_STRING} ^(.*)$
+ u# p6 c# A6 N - RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
. X- j6 V1 N" c - RewriteCond %{QUERY_STRING} ^(.*)$& C9 b" a. \7 P, o# k0 ~# B2 c
- RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1! q0 d! J+ e$ `5 Q; Z3 K
- RewriteCond %{QUERY_STRING} ^(.*)$
2 K" e5 ^7 T, F3 y2 b - RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%14 `/ z/ R4 [) n5 K* I" Y4 l
- RewriteCond %{QUERY_STRING} ^(.*)$
' S8 j* ~% G( w! } - RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1
5 M9 v; ~0 d B3 a
銴鋆賭誨蝣 2.Discuz3.2隢憯敺->典->SEO閮剔蔭->URL->暸豢 , 蝡喟9 G8 G; c( F6 h$ i
寞鈭雿輻杗pacherewrite(mod_rewrite)閮剖- D; P4 t5 B4 S! G+ z# S
1./etc/httpd/conf/httpd.conf找<VirtualHost *:80>抒<Directory "/home/domain/public_html">,, F% W; |& p. I- `+ ]( }8 ~
/etc/httpd/conf.d/砌蜓璈閮剖瑼憒virtual.conf找<VirtualHost *:80>抒<Directory "/home/domain/public_html">. Q# E8 b! |: x8 v; s: `& C
憓隞乩批捆:! F6 v! r2 G5 P
4 ?* W- _$ j( V3 Z% u8 x! E
- RewriteEngine On% m e+ f6 s j4 W Q0 g8 X. o
- RewriteCond %{QUERY_STRING} ^(.*)$- z- x0 e, `" U
- RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topicid=$1&%1
, i4 S6 s; K9 Z& F+ ^ - RewriteCond %{QUERY_STRING} ^(.*)$3 ~6 ^8 ]0 `3 S2 w. S
- RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1: j8 d5 I& ^0 r/ _: A9 t3 H/ ]
- RewriteCond %{QUERY_STRING} ^(.*)$
- z! B L H8 H - RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1# l& ^# p2 Z0 g. l* }0 O
- RewriteCond %{QUERY_STRING} ^(.*)$( \# A0 H6 |2 M
- RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1) p) N1 D5 l# H
- RewriteCond %{QUERY_STRING} ^(.*)$8 [$ [' _ j( K
- RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1+ X- V2 c' W" S
- RewriteCond %{QUERY_STRING} ^(.*)$ d! G. L( i8 U* R2 J
- RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
! s/ B1 T$ C+ M; ~ - RewriteCond %{QUERY_STRING} ^(.*)$
3 I7 n' i- O& e - RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1. ], Q W: b1 ]6 p
- RewriteCond %{QUERY_STRING} ^(.*)$, w) k0 T9 d" g0 a6 D
- RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1
8 B! Y0 a( X* Y j" Y" W
銴鋆賭誨蝣 2./etc/httpd/conf/httpd.conf折3 q1 E. P# I4 v: ~/ q! p
LoadModule rewrite_module modules/mod_rewrite.so 銝銵
- l( C8 n: Z6 G! W* W( H# J嗅 httpd ==> service httpd restart6 W$ U. p# V) T) P
# A& M7 k- A/ k. l5 F
# w# }* |/ u) E6 ~) t [ |
|