本帖最后由 dewfn 于 2018-3-20 02:02 编辑
- <font style="vertical-align: inherit;"><font style="vertical-align: inherit;">IIS7 / 8</font></font>
复制代码<rule name =“目录结尾自动加斜杠”stopProcessing =“true”>
<match url =“^(。*)$”ignoreCase =“false”/>
<conditions logicalGrouping =“MatchAll”>
<add input =“ {REQUEST_FILENAME}“matchType =”IsFile“ignoreCase =”false“negate =”true“/>
<add input =”{URL}“pattern =”(。*)/ $“ignoreCase =”false“negate =”true“ />
</ conditions>
<action type =“Redirect”url =“{R:1} /”redirectType =“永久”/>
</ rule>
<rule name =“HTTP跳转到HTTPS”enabled =“true”stopProcessing =“true”>
<match url =“(。*)”/>
<条件>
<add input =“{HTTP_HOST}”pattern =“^(localhost)”negate =“true”/>
<add input =“{HTTPS}”pattern =“^ OFF $”/>
</ conditions>
< action type =“Redirect”url =“https:// {HTTP_HOST} {R:1}”redirectType =“永久”/>
</ rule>
如果顶级域名要跳转到二级域名(比如不带www的跳转到带www)且目录一一对应用顶级域名建一个新站并绑定如果开启了ssl记得把https的顶级域名一起绑定了
然后用以下规则即可实现跳转。
<httpRedirect enabled =“true”destination =“https://www.你的域名.com$S$Q”exactDestination =“true”httpResponseStatus =“Permanent”/>
或者手动添加
|