- <?xml version="1.0" ?>
- <configuration>
- <location allowOverride="false" inheritInChildApplications="false" path=".">
- <system.webServer>
- <rewrite>
- <rules>
- <rule name="HTTP to HTTPS redirect" stopProcessing="true">
- <match url="(.*)" />
- <conditions>
- <add input="{HTTPS}" pattern="off" ignoreCase="true" />
- </conditions>
- <action type="Redirect" url="https://{HTTP_HOST}/{R:1}"
- redirectType="Permanent" />
- </rule>
- </rules>
- <outboundRules>
- <rule name="Add Strict-Transport-Security when HTTPS" enabled="true">
- <match serverVariable="RESPONSE_Strict_Transport_Security"
- pattern=".*" />
- <conditions>
- <add input="{HTTPS}" pattern="on" ignoreCase="true" />
- </conditions>
- <action type="Rewrite" value="max-age=31536000" />
- </rule>
- </outboundRules>
- <rules configSource="web_config\rewrite.config"></rules>
- </rewrite>
- <defaultDocument configSource="web_config\default.config"></defaultDocument>
- <httpErrors configSource="web_config\httpErrors.config"></httpErrors>
- <handlers configSource="web_config\php.config"></handlers>
- </system.webServer>
- </location>
- </configuration>
复制代码
试试 |