以本站为例,本站域名www.shenzhenwo.com,shenzhenwo.com,www.shenzhenwo.cn,shenzhenwo.cn
目标:将所有域名301跳转到www.shenzhenwo.com,好处我就不说了,绝对有利于SEO,所有域名的权重将集中在www.shenzhenwo.com这个域名上,包括PR,收录等等。
1、在IIS里网站(主站)的所有主机头删除,只留www.shenzhenwo.com这一个主机头
2、新建一个网站,暂且命名为ReURL,网站目录可以为空,将新建的这个网站的主机头设为 shenzhenwo.com,www.shenzhenwo.cn,shenzhenwo.cn这三个。
3、设置ReURL的属性,在“重定向到”一栏里面输入“http://www.shenzhenwo.com$S$Q”,然后在“上面输入的准确URL”和“资源的永久重定向”两个选项前面打钩,最后点应用,就此301重定向全部设置完成。
4、二级域名的设置方法也跟上面步骤一样,如要将www.shenzhenwo.com/bbs 301转向为bbs.shenzhenwo.com。也许你会说我直接设置个二级域名就可以了,但是搜索引擎会认为www.shenzhenwo.com/bbs/1.htm 和bbs.shenzhenwo.com/1.htm是两个不同的页面,但事实上这两个页面是一样的,因此会分散这个页面的权重。
---------------------------重定向的参数说明--------------------------
Microsoft's Internet Information Server ( MS IIS ) is very different from Apache, and you need to handle redirects on it differently.
Although you can use the popular FrontPage web development software with Apache + FP extensions, most people who use FrontPage prefer to use IIS. Also, Microsoft's .NET and ASP development platforms usually work best on MS IIS (no surprise there).
Definitions for Terms used in this Article
Detailed Information
Overview
What you are trying to accomplish here is to have one resource (either a page or an entire site) redirect a visitor to a completely different page or site, and while doing so tell the visitor's browser that the redirect is either permanent (301) or temporary (302).
Therefore you need to do three things:
Have 2 resources - one source page or website, and one destination page or website.
When an attempt to access the source resource is made, IIS transfers the visitor to the destination instead.
During the transfer, IIS reports to the visitor that a redirect is happening and it's either temporary or permanent.
The good news is that IIS has always supported this, and you can use it's control panel to make the redirect.
Administrator Mode - Redirecting a Domain
If you can log into the Windows 2000 (or higher) server and access the desktop, then choose:
Start > Programs > Administrative Tools > Internet Services Manager
if(request.ServerVariables("SERVER_NAME")="javamilk.cn") then
Response.Status="302 Moved Permanently"
Response.AddHeader "Location","http://www.javamilk.cn/"
Response.End
end if
%>