对于设置301重定向有很多好处,其中之一就是利于seo防止搜索引擎误操作将多域名站点设置为作弊站点,同时也减少权重分散,像访问www.ihuan.me/1046.html则会被跳转到ihuan.me/1046.html增强流量的汇集。具体方法如下。

1.新建一个站点,对应目录如D:\wwwroot\301web。该目录下只需要1个文件,即index.html或者加个404.htm。绑定要跳转的域名,如图:
2.在IIS中选中刚才我们建立的站点,右键,属性,主目录,选择重定向到,输入网址如:http://www.xxxx.com,同时注意选中下面的资源的永久重定向选项。如下图:
3.到此,我们已经完成了将xxxx.com这个域名301重定向到www.xxxx.com的工作。
注意问题:
“上面输入准确的 URL(X)”这个选项建议不要选。
不选的结果是:
当输入xxxx.com转到了www.xxxx.com,
当输入xxxx.com/sanwen/suibi/时,转到了www.xxxx.com/sanwen/suibi/。
选上的结果是:
当你输入xxxx.com或者xxxx.com/sanwen/suibi/都会转到www.xxxx.com。
好了,如果只是想把不带www的转到带www的或者其他没有用过的域名转到正在使用的域名,这样就可以了。但是如果你要的域名已经做过网站,想要把权重传递给新网站,可以参考下面这个方法:
第一步同上,主要是第二步,如图:
注意红色字体的部分,在重定向到地址的后面多了$S$Q字符,即写成了http://www.xxxx.com$S$Q。“上面输入准确的 URL(X)”这个选项也打了勾。
对于$S$Q字符,这里解释一下:
$S 将请求的URL 的后缀传递给新的URL。后缀是用重定向的URL 代替之后,初始URL 中所保留的部分。
如果未设置 EXACT_DESTINATION 标志,则结果目标URL 的名称将具有所请求文件的名称(作为文件夹名称)以及文件名本身。
$Q 将初始URL 中的参数(如 querystring 参数)传递至新的 URL,包括问号(?)。
如果不加上$S$Q字符的话,内页的301都会跳转到首页,加上$S$Q字符的目的就是内页也能准确的跳转到新域名的对应内页。
好了,这样就完成了301永久重定向的设置,设置好之后最好能测试下是否返回的是301值,推荐个网址:http://www.seoconsultants.com/tools/headers。
百度对301的反应并不像想象中那么慢,第二天就收录了xxxx.com这个页面,快照最新。当然,快照的内容是www.xxxx.com的内容,而不是301web里index.html的内容。
Hmm is anyone else having problems with the images on this blog loading?
I’m trying to determine if its a problem on my end or if it’s the blog.
Any feed-back would be greatly appreciated.
2018年8月18日 21:53I love your blog.. very nice colors & theme. Did you make this website yourself or did you hire someone to do it for you?
2018年8月18日 17:37Plz reply as I’m looking to create my own blog and
would like to know where u got this from.
kudos
Algarve é uma peça importante no turismo em Portugal.
2018年8月18日 13:11So what does this need to do with your article?
2018年8月18日 12:25What’s up, for all time i used to check blog posts
2018年8月18日 11:53here in the early hours in the dawn, since i enjoy to learn more and more.
Greetings! Very useful advice within this article!
2018年8月18日 11:10It is the little changes which will make the largest changes.
Many thanks for sharing!
Hi there, I think your site could possibly be having browser compatibility
2018年8月18日 06:16issues. When I look at your website in Safari, it looks fine however, when opening in IE, it’s got some overlapping issues.
I just wanted to give you a quick heads up!
Besides that, wonderful site!
I’ve been surfing online more than 4 hours today, yet I never found any interesting article like yours.
2018年8月18日 05:16It is pretty worth enough for me. In my view, if all webmasters and bloggers made good
content as you did, the internet will be much more useful than ever before.
This is my first time go to see at here and
2018年8月18日 02:18i am in fact pleassant to read all at alone place.
Hello Dear, are you really visiting this website
2018年8月17日 23:54on a regular basis, if so afterward you will definitely get good experience.