开发者

Both www. and http:// websites are available 302

I am trying to optimize my website for Google, and now both www. and http:// give the same results indicatin开发者_如何学编程g that Google is considering a duplicate content. I want only http://, and www. to be redirected.

Thanks.


Google can usually figure this stuff out for itself but if you need to give it a hint you can use Googles 'webmaster tools'. Also you should generally use 301 (Permanent) rather than 302 for this.


If you are using Apache, in your .htaccess or in an equivalent place:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www.example.com
    RewriteRule (.*) http://example.com/$1 [R=301,L]
</IfModule>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜