能用的iis7 301跳转

index301.htaccess 必须写到.htaccess后缀的文件里,
1.在iis7的URL Rewrite中右侧点击Import Rules导入.htaccess文件
把henghengw.com 跳转到www.henghengw.com其他链接不跳转

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^henghengw.com$ [NC]
RewriteRule ^(.*)$http://www.henghengw.com/$1[R=301,L]
</IfModule>

其实应该也可以试试直接在web.config里写规则

<rule name="index301" stopProcessing="true">
          <match url="^(.*)$" ignoreCase="false" />
          <conditions logicalGrouping="MatchAll">
            <add input="{HTTP_HOST}" pattern="^henghengw.com$" />
          </conditions>
          <action type="Redirect" url="http://www.henghengw.com/{R:1}" redirectType="Permanent" />
        </rule>

相关文章:

  • 2021-11-01
  • 2021-09-18
  • 2021-10-05
  • 2021-09-01
  • 2021-08-17
  • 2022-02-27
  • 2022-01-30
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-01
  • 2022-02-18
  • 2022-12-23
  • 2022-02-09
  • 2021-07-29
相关资源
相似解决方案