<rewrite> //http 跳转到 https <rules> <rule name="HTTP to HTTPS redirect" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTPS}" pattern="off" ignoreCase="true" /> </conditions> <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" /> </rule> //下面这个是不带www跳转到带www <rule name="www" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{HTTP_HOST}" pattern="^zhjx66\.com$" /> </conditions> <action type="Redirect" url="https://www.zhjx66.com/{R:0}" /> </rule> </rules> </rewrite>