Hi all,
I just installed the module GoogleSitemap on my client site. zenclimb.com. I tried to submit sitemap link http://zenclimb.com/sitemap.xml to Google, but Google would not accept URL without the prefix www. So I added prefix www in config.php. It works if just type zenclimb.com, it will redirect to http://www.zenclimb.com. However, if I add the sub pages, http://zenclimb.com/programs.html, it will not add prefix www. The problem is Google still not recognize my sitemap URL.
Do you know if there is any ways to add prefix www permanently?
Thanks in advance!
Jason
how to add prefix www to URL permanently [solved]
how to add prefix www to URL permanently [solved]
Last edited by coolji on Mon Aug 29, 2011 4:03 am, edited 1 time in total.
Re: how to add prefix www to URL permanently
I found a solution to add prefix www.
RewriteCond %{HTTP_HOST} ^mysite\.com
RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=permanent,L]
Howerver, Google still not reconize this change. Here is the error message from Google.
Thanks,
Jason
RewriteCond %{HTTP_HOST} ^mysite\.com
RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=permanent,L]
Howerver, Google still not reconize this change. Here is the error message from Google.
Do you have any solutions?Paths don't match
We've detected that you submitted your Sitemap using a URL path that includes the www prefix (for instance, http://www.example.com/sitemap.xml). However, the URLs listed inside your Sitemap don't use the www prefix (for instance, http://example.com/myfile.htm).
Thanks,
Jason
Re: how to add prefix www to URL permanently
How does your config.php $config['root_url'] look like?
I bet there is www. missing that is why your sitemap is created without www.
I bet there is www. missing that is why your sitemap is created without www.
Re: how to add prefix www to URL permanently
Yes, there was www. missing in the config.php. It has been added.
But I still need to add the following in .htaccess to make it fully work.
RewriteCond %{HTTP_HOST} ^mysite\.com
RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=permanent,L]
Now Google has accepted my sitemap. I guess when I added URL redirect in .htacccess, it took a while to update in Google. Now everything works fine.
But I still need to add the following in .htaccess to make it fully work.
RewriteCond %{HTTP_HOST} ^mysite\.com
RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=permanent,L]
Now Google has accepted my sitemap. I guess when I added URL redirect in .htacccess, it took a while to update in Google. Now everything works fine.
Re: how to add prefix www to URL permanently
So this question is resolved?
Maybe could you edit the first post so it shows [solved] in the title?
Thank you!
Maybe could you edit the first post so it shows [solved] in the title?
Thank you!
Make your community a better place!