本规则只限于EMLOG 3.58 b( c! `& u' ]4 F8 u
- t0 o! q/ X4 I" j" G) b
随着Windows2008服务器的普及,IIS7/7.5逐渐普及起来,现在特向广大emer提供emlog基于IIS7/7.5 + mod_rewrite的重写规则- S6 J( ?0 [. G
把下列配置字段保存为web.config放在博客根目录即可生效. X' p8 q0 f1 ?- }% H
如果你的空间已经有了web.config,那么就只需要将下面<rewrite></rwrite>标签中的配置信息增加到你的web.config文件中的<system.webServer></system.webServer>配置段中即可' |' }9 J4 G0 _+ K
本配置已经在IIS7.5上测试通过+ s, d4 C' G% n( Z1 m0 P( O0 ]
x; K. g* s8 `5 t. H<?xml version="1.0" encoding="UTF-8"?>
' a/ T3 C- @! h<configuration>0 u0 E+ K8 f6 ?- q; C8 w5 P$ |8 w: P
<system.webServer>1 L: N- M& K" p; b
<rewrite>, m& [. d& ^: Q
<rules>
# E" H' U- e7 J3 K! G <rule name="emlog-rewrite-file">
6 B9 c$ T' k+ a <match url="^(post|record|sort|author|page)-([0-9]+)\.html$" />) F& Z' M3 e5 D& _5 H. e* X2 S/ N
<action type="Rewrite" url="index.php?{R:1}={R:2}" />) b8 p7 V, D s- x) t" Y" e
</rule>
8 w) c. `6 x# B( B* ~1 Z& u: v <rule name="emlog-rewrite-folder">- i3 D% ~* X' f1 n+ V
<match url="^(post|record|sort|author|page)/([0-9]+)$" />+ s% e z6 r; x5 Q/ j: I
<action type="Rewrite" url="index.php?{R:1}={R:2}" />
2 [) A. I6 [2 o9 Y R, Q8 }1 c </rule>" V* U% J) S5 H9 U- z H1 @
<rule name="emlog-rewrite-tag-file">, q/ p$ `2 Q7 h- j0 v" d
<match url="^tag-(.+)\.html$" />* ^% P# F y" M" p1 ^0 l
<action type="Rewrite" url="index.php?tag={R:1}" />
4 H {0 p4 V0 h- z+ {& ?2 F3 C/ E </rule>
# |8 _# t* K+ d$ S <rule name="emlog-rewrite-tag-folder">% ^: O. X" r# D3 w
<match url="^tag/(.+)$" />
" G) A! L& L, o2 X. ^ <action type="Rewrite" url="index.php?tag={R:1}" />
. _8 A' v. a+ R7 t7 E2 \$ v, J </rule>& ]# j% Q3 V6 {/ p
<rule name="emlog-rewrite-twitter-file">
6 z& ^4 P _. V <match url="^t/page-([0-9]+)\.html$" />& V# ~9 E( j s2 c
<action type="Rewrite" url="t/index.php?page={R:1}" />
- [: D+ E" ?* `1 @8 A: I, O </rule>& [/ R, W8 B' c0 q& ^9 G) v+ Z
<rule name="emlog-rewrite-twitter-folder">
/ }, ^: k) A7 g9 Y0 a6 C" @ <match url="^t/page/([0-9]+)$" />
+ P2 E- E! V1 O, @ x1 ?6 D( n% `3 H <action type="Rewrite" url="t/index.php?page={R:1}" />+ \5 C! h3 j4 ]5 b4 a
</rule>; U8 [7 X- Z( t" V& @
</rules>4 R! C2 q# [1 T, ?: M; R* s9 P
</rewrite>
- \, }% { h5 l </system.webServer>; p: F% r7 ~( [
</configuration>
( c: P5 ~/ r# P( E( [ |