No "www" in front of our URL in Google listing?
Basically our website is listed in Google but the URL only has "ourdomain.com" whereas we'd like it to properly have "www.ourdomain.com".
Is there a way to inform the Google spiders o开发者_运维百科f this? A meta tag? A setting in our httpd? Or is it a DNS host setting we'll need to contact our hosting provider about?
This can actually be controlled from Google's webmaster tools. You'll have to go through the site verification process first, but once it's set up, you can apply your preference for how the domain displays in search result listings.
You should setup a 301 Permanent Redirect that points to your www. address. This can be done by adding the following to your .htaccess file.
## Redirect to www.
RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
That way when Google next indexes your site, their bots should pick up this redirect and update their listings.
You can do it with Webmaster-Tools by google: http://www.google.com/webmasters/tools/. Confirm you're website and somewhere there is an option to it.
Using Google Webmaster Tools to tell Google your preference (you will need to create a Google Account if you don't have it and validate your domain)
Using Canonical Link Tag in your <head>
section, so other search engines also know your preferences:
<link rel="canonical" href="http://www.example.com/" />
Adding Redirect in your .htaccess file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
精彩评论