www.example.com
example.com/
www.example.com/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]
注意:url标准化的301重定向(以上代码)需要写在其他url-rewrite代码之前。
以上就是301重定向怎么进行url标准化设置的详细内容。
