rgbart

Welcome to rgbart, here will provide you with a wealth of web design Cool Sites

导航

« 梦幻西游的四个专题页面网页设计师是怎样下地狱的 »

301重定向怎么进行URL标准化设置?

经常会碰到这样的情况,其他网站链接你的站点时,会用下面的链接:

www.example.com
example.com/
www.example.om/index.html
example.com/index.php

而这样导致:你站点主域名的pr值分散到其他几个URLs了。

如果你用301重定向把其他三个URL转到
www.example.com
PR也就集中在主域名:www.example.com 了。

301重定向具体办法:

设置.htaccess文件(只适用于linux系统,并需要虚拟主机支持。)

使访问example.com/的时候就会自动转到www.example.com
在.htaccess文件里写上以下代码即可。

RewriteEngine on
RewriteCond %{http_host} ^mydomain.com [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [L,R=301]

 

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

Recent Comments

Recent Article

Powered By Z-Blog 1.8 Arwen Build 81206

Copyright 2009-2010 www.rgbart.net. Rights Reserved.