小冬SEO

Web.config配置301指定某个链接到指定链接

2020-04-02 22:41:09 5904 织梦安全

很多时候我们在给网站做调整的时候,就会遇到链接需要跳转的情况,这里我们就来分享一下常用的几种301跳转。

 

1、去掉网站首页后缀的index.html301写法

 
 
<rule name="去掉后缀index.html" stopProcessing="true">
<match url="^index.html" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="http://www.cdseoyh.cn" />
</rule>
 

2、不带www的跳转到带www的网址301写法

 
 
<rule name="www跳转" stopProcessing="true">
    <match url="(.*)" />
    <conditions logicalGrouping="MatchAny">
    <add input="{HTTP_HOST}" pattern="^cdseoyh.cn$" />
    </conditions>
    <action type="Redirect" url="http://www.cdseoyh.cn/{R:0}" redirectType="Permanent" />
</rule>
 

3、指定某个页面跳转到首页的301写法

 
 
<rule name="指定页面301到首页" stopProcessing="true">
<match url="^m/$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="http://m.cdseoyh.cn/{R:1}"/>
</rule>
 

在3中,指定页面是http://www.cdseoyh.cn/m/跳转到http://m.cdseoyh.cn

版权保护: 本文由小冬SEO编辑发布,转载请保留链接: https://www.cdseoyh.cn/cms/dedesafe/74.html

小冬SEO 草根seoer,从事搜索引擎关键词优化,喜欢学习专研各类SEO优化技巧—小冬SEO博客
  • 138文章总数
  • 5905本页访问
  • 运营时间
  • 标签

    友情链接

      {dede:sql sql="select url,webname from dede_flink where typeid = (select id from dede_flinktype where typename=~typename~)"}
    • [field:webname/]
    • {/dede:sql}