Hello,
We are trying to output hreflangs, which works fine for normal content pages, and we can get the search engine friendly url by this method: SearchEngineFriendlyURLs.GetFriendlyUrl().
But for ecommerce paths the query parameters for GroupID and ProductID are translated to paths for the current language without looking at the ID for the full url. This is our current code:
@foreach (var language in GetLoop("Languages"))
{
var qs = HttpUtility.ParseQueryString(System.Web.HttpContext.Current.Request.QueryString.ToString());
qs.Set("ID", language.GetString("PageID"));
var url = "https://" + language.GetString("PrimaryDomain") + "/Default.aspx?" + qs.ToString();
<link rel="alternate" hreflang='language.GetString("Culture")' href="@url" />
}
Does any have a way to get the right search engine friendly url for e.g. ecommerce paths?
Best regards, Anders