Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

After searching my site on Google I have found that the URL that is shown doesn't contain www at the beginning, why?

This is my virtualhost:

<VirtualHost *:80>
  ServerName estebancortijo.com

  Redirect / http://www.estebancortijo.com/
</VirtualHost>

<VirtualHost *:80>
  ServerName www.estebancortijo.com

  SetEnv MYAPP_ENV prod

  DocumentRoot /var/www/jesusesteban/web
  <Directory /var/www/jesusesteban/web/>
      # Options Indexes FollowSymLinks MultiViews
      AllowOverride None
      Order allow,deny
      allow from all
      <IfModule mod_mime.c>
          Addtype font/truetype .ttf
          AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css font/opentype font/truetype
      </IfModule>
      <IfModule mod_rewrite.c>
          Options -MultiViews

          RewriteEngine On
          #RewriteBase /path/to/app
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteRule ^ index.php [QSA,L]
      </IfModule>
      <IfModule mod_expires.c>
          ExpiresActive On
      ExpiresDefault "access plus 10 days"
      ExpiresByType text/css "access plus 1 week"
      ExpiresByType text/plain "access plus 1 month"
      ExpiresByType image/gif "access plus 1 month"
      ExpiresByType image/png "access plus 1 month"
      ExpiresByType image/jpeg "access plus 1 month"
      ExpiresByType application/x-javascript "access plus 1 month"
      ExpiresByType application/javascript "access plus 1 week"
      ExpiresByType application/x-icon "access plus 1 year"
      </IfModule>
    </Directory>
</VirtualHost>

I have the same configuration for another site, but in that case the www is shown in Google results.

Any idea?

share|improve this question
    
@ John Conde - Thanks for the great info but i don't know why i am not able to set my preferred domain for one blog its - Dreamtechie.com .. –  user27211 Jul 29 '13 at 9:58

3 Answers 3

If you want to explicitly tell Google to show your domain with the www you can set your preferred domain in your Google Webmaster Account.

The preferred domain is the one that you would liked used to index your site's pages (sometimes this is referred to as the canonical domain). Links may point to your site using both the www and non-www versions of the URL (for instance, http://www.example.com and http://example.com). The preferred domain is the version that you want used for your site in the search results.

If you see a message that your site is not indexed, it may be because it is indexed under a different domain. For example, if you receive a message that http://example.com is not indexed, make sure that you've also added http://www.example.com to your account (or vice versa), and check the data for that site.

Once you tell us your preferred domain name, we use that information for all future crawls of your site and indexing refreshes. For instance, if you specify your preferred domain as http://www.example.com and we find a link to your site that is formatted as http://example.com, we follow that link as http://www.example.com instead. In addition, we'll take your preference into account when displaying the URLs. If you don't specify a preferred domain, we may treat the www and non-www versions of the domain as separate references to separate pages.

It may take some time before you see this change fully reflected in our index. All pages that currently display the non-preferred version of the URL in the index will remain in the index that way until we refresh our indexing of those pages.

Specify a preferred domain:

1.On the Webmaster Tools Home page, click the site you want.

2.Click the gear icon , and then click Site Settings.

3.In the Preferred domain section, select the option you want.

You may need to verify ownership of both the www and non-www versions of your domain. Because setting a preferred domain impacts both crawling and indexing, we need to ensure that you own both versions. Typically, both versions point to the same physical location, but this is not always the case. Generally, once you have verified one version of the domain, we can easily verify the other using the original verification method. However, if you've removed the file, meta tag, or DNS record, you'll need to repeat the verification steps.

Note: Once you've set your preferred domain, you may want to use a 301 redirect to redirect traffic from your non-preferred domain, so that other search engines and visitors know which version you prefer.

share|improve this answer

As bybe pointed out, you are redirecting from non-www prefix to www prefix URLs, which is normally enough to change the way URLs are listed the SERPs.

However the redirect is incorrectly defined as a temporary 302 redirected. 302 redirects are notorious for causing issues in Google cache and you should be using a permanent 301 redirect instead.

share|improve this answer

Looking at your site. Your site is enforcing www. which means that it's impossible to access your site without www. since the browser will redirect. Since the Googlebot would be redirected as a user would Google would not index no-www URLs unless both www. and no-www versions were accessible.

From the looks of it, you have recently enforced www. Within your vhost conf file, Google is renowned for taking weeks, months and in some cases can take a whole year depending on the volume of URLs.

I believe that Google does this on purpose, obviously it doesn't want webmasters constantly changing URLS but also it doesn't want to quickly index something that could be a webmaster hiccup with consequences of hurting his or her rankings, so I believe that Google will monitor the page, and site then after X crawls it'll reflect those changes. Now how many crawls, time or what not is anyone's guess but this is completely normal.

Google is aware of your changes since I can see newer pages with www. in the index, to answer your question and correct me if I'm wrong in anyway, you just need to wait longer!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.