广告
其他网站相关知识您现在的位置是:主页 > 其他网站相关知识 >

IIS伪静态规则web.config让http自动跳转到https

2023-01-09 13:53:05其他网站相关知识 157人已围观

web.config代码如下

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
	<system.webServer>
        <rewrite>
            <rules>
				<rule name="301" stopProcessing="true">
					<match url="^(.*)$" ignoreCase="false" ></match>
					<conditions logicalGrouping="MatchAll">                       
					<add input="{HTTP_FROM_HTTPS}" pattern="^on$" negate="true" ></add>  
					</conditions>
					<action type="Redirect" url="https://www.baidu.com/{R:1}" redirectType="Permanent" ></action>
				</rule>
			</rules>
		</rewrite>
	</system.webServer> 
</configuration>

 

联系微信


扫码联系技术微信

---------------专业解决网站各种疑难杂症,可淘宝担保交易,安全无风险---------------
建站、仿站、二次开发、网站改版、网站修改、网站漏洞修复、网站被黑修复、网站安全、服务器安全等
点击了解更多 >>

广告
广告
联系微信