|
3、(重要)当Asp网站不存在原有配置文件时,将网站目录下的web.config文件内容替换成以下代码即可
- <?xml version=”1.0″ ?>
- <configuration>
- <location path=”.” allowOverride=”false” inheritInChildApplications=”false”>
- <system.webServer>
- <rewrite>
- <rules>
- <rule name=”http_toHttps” stopProcessing=”true”>
- <match url=”(.*)”/>
- <conditions>
- <add input=”{HTTPS}” pattern=”off” ignoreCase=”true”/>
- </conditions>
- <action type=”Redirect” redirectType=”Permanent” url=”https://{HTTP_HOST}/{R:1}”/>
- </rule>
- </rules>
- </rewrite>
- </system.webServer>
- </location>
- </configuration>
复制代码
手动修改后的代码:
注意1:如果【图1】中存在<system.webServer>/<rewrite>/<rules>,则直接加入在下级节点
注意2:如果【图1】中不存在<system.webServer>/<rewrite>/<rules>,则需要手动添加,下图为手动添加【<system.webServer>/<rewrite>/<rules>】
文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/156380.html<