Bug reports Found a bug? Post it here please.
Version 5.x > Bug reports > Google Sitemap doesn't check lang querystring parameters View modes: 
User avatar
Member
Member
srizzetto-microgate - 8/25/2010 11:44:40 AM
   
Google Sitemap doesn't check lang querystring parameters
If you have a multi-language site and want to submit separate google sitemaps to the webmaster tool, you can't specify the lang query string parameters (it checks only the cookie)

eg. http://mysite.com/CMSPages/GoogleSitemap.aspx?lang=it-IT

I resolved adding this code to page load event... hope this helps


protected void Page_Load(object sender, EventArgs e)
{
Response.ContentType = "text/xml";
googleSitemap.StopProcessing = true;

string lang = String.Empty;
if (Request.QueryString["lang"] != null && !String.IsNullOrEmpty(Request.QueryString["lang"].ToString()))
{
lang = Request.QueryString["lang"].ToString();
}
else
{
//check domain
System.Uri url = Request.Url;
string hostname = url.Host.ToLower();
switch (hostname)
{
case "www.myDomain.it":
lang = "it-IT";
break;
case "www.myDomain.com":
lang = "en-US";
break;
case "www.myDomain.de":
lang = "de-DE";
break;
/* etc */
default:
lang = "en-US";
break;
}
}
googleSitemap.CultureCode = lang;
googleSitemap.ReloadData(true);
}

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 9/6/2010 2:49:47 AM
   
RE:Google Sitemap doesn't check lang querystring parameters
Hi,

Thank you for your post. In addition to that I would like to post here also how to ensure generating all documents from all language versions in the XML format. For more details please see this KB article.

Best regards,
Juraj Ondrus