在WEB.config里面放入下列代码
- p$ J1 Z& Y! A7 O( t8 o, \8 k3 j' }# ~+ ~
<?xml version="1.0"?>
2 {. h5 d4 s/ ^7 N. t7 ?; _<configuration>: z1 U6 |: a' Y- o: G9 B8 m
<system.webServer>
' P4 w6 g3 B+ e- ^4 B# k& L6 W<rewrite>
, K+ C, d: H d0 p# v' m<rules>
. w# U& Z$ L, I( e* \<rule name="WWW Redirect" stopProcessing="true">
# j6 q A* g9 I6 K<match url=".*" />
2 N+ r: U; f, W6 b) |; q4 A<conditions> $ E) Y* r" ]9 U7 K2 h. Y0 h
<add input="{HTTP_HOST}" pattern="^w10.cn$" /> * \6 l6 _% F/ R9 B1 Y
</conditions> 3 z8 Y$ V0 S3 p2 w3 C
<action type="Redirect" url="https://bbs.w10.cn/{R:0}" c0 }% U* H0 X5 ?' ]- q) ~
redirectType="Permanent" />
0 f0 r: }( h5 [: S* I</rule>
- l2 _. r% ~# z: R5 b</rules> * ~7 E$ i2 n2 g$ J
</rewrite> 7 P/ b) C+ I2 a+ t9 G
</system.webServer>
: l1 N: \5 Z% `! D- p$ d! a `5 d5 R. h+ N) }
</configuration>% _! d4 m- O& J* k' K0 u
$ X: y/ E7 e( q* B; m# \红色这段一定是放在<configuration>之下,其它之上的 |