• 周一. 6月 24th, 2024

5G编程聚合网

5G时代下一个聚合的编程学习网

热门标签

IIS配置web.config 将带www域名转为不带www域名

admin

11月 28, 2021

在configuration节点中添加

<configuration>
  <system.webServer>
    <rewrite>
      <rules>
     <!--http转https-->
        <rule name="Redirect to https" stopProcessing="true">
          <match url="(.*)" />
          <conditions>
            <add input="{HTTPS}" pattern="^OFF$" />
          </conditions>
          <action type="Redirect" url="https://{HTTP_HOST}:443/{R:1}" redirectType="SeeOther" />
        </rule>
        <!--将带www转为不带www-->
        <rule name="WWW Redirect" stopProcessing="true">
          <match url=".*" />
          <conditions>
            <add input="{HTTP_HOST}" pattern="^www.xxx.com$"/>
          </conditions>
          <action type="Redirect" url="https://xxx.com/{R:0}" redirectType="Permanent" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

《IIS配置web.config 将带www域名转为不带www域名》有4个想法
  1. Wow, wonderful weblog structure! How long have you been running a blog for?
    you made running a blog look easy. The entire glance of your site is great, let alone the content!
    You can see similar here ecommerce

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注