web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpRedirect enabled="true" destination="http://www.onestopweb.cn" />
</system.webServer>
</configuration>
例如:在浏览器输入 baidu.com,会重定向到 https://www.baidu.com/。
效果图:
本文介绍如何使用web.config文件实现HTTP重定向,通过设置<httpRedirectenabled>标签,可将用户请求从一个URL重定向到另一个指定的URL。例如,通过在web.config中配置<httpRedirectenabled=true destination=http://www.onestopweb.cn/>,当用户在浏览器中输入baidu.com时,请求会被重定向到https://www.baidu.com/。
2536

被折叠的 条评论
为什么被折叠?



