- 导航
之前做程序的时候,一直忽略了个问题,就是一些页面的首页链接,不是用的主域名,而是用的index.html,导致现在百度的site出来的结果,主域名不在第一页,而是带index.html,这样看起来似乎没什么问题,但我感觉会被分散权重,于是今天在服务器上做了301跳转,我用的是IIS服务器,在web.config设置的,现在直接列出代码。
<rewrite>
<rules>
<rule name="301Redirect" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^$" />
</conditions>
<action type="Redirect" url="http://www.rr555.com/{R:0}"
redirectType="Permanent"/>
</rule>
<rule name="homeIndex">
<match url="^index.html$" ignoreCase="false" />
<action type="Redirect" url="/" appendQueryString="false"
redirectType="Permanent" />
</rule>
</rules>
</rewrite>
信息来源:网站管理员
添加时间:2016-04-09
浏览次数:
分享到:
加微信
首页