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

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

2025/6/30 83次
香港云服务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

版权声明

    声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们996811936@qq.com进行处理。