首页>>帮助中心>>香港云服务IIS利用web.config文件设置https的301跳转

香港云服务IIS利用web.config文件设置https的301跳转

2025/6/30 16次
香港云服务IIS利用web.config文件设置https的301跳转

将下列代码粘贴进站点根目录下的web.config文件里服的

<system.webServer>节点下保存即可

<rewrite>

<rules>

<rule name="wwwRedirect" stopProcessing="true">

<match url=".*" />

<conditions>

<add input="{HTTP_HOST}" pattern="^wu-168.cn$"/>

</conditions>

<action type="Redirect"url="https://www.enuoidc.com/{R:0}" redirectType="Permanent" />

</rule>

<rule name="HTTP to HTTPS redirect"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>



购买使用一诺网络香港服务器,可以极大降低初创企业、中小企业以及个人开发者等用户群体的整体IT使用成本,无需亲自搭建基础设施、简化了运维和管理的日常工作量,使用户能够更专注于自身的业务发展和创新。香港服务器低至29元/月,购买链接:https://www.enuoidc.com/vps.html?typeid=2