My variable langURL
currently returns a non-friendly URL like so: http://localhost:57299/link/457fee1669e348febf67ecb57b281945.aspx?epslanguage=de-AT
Is it possible to get a friendly URL?
public static IHtmlString HrefLangLinks(this PageData currentPage)
{
var availablePageLanguages = currentPage.ExistingLanguages.Select(culture => culture.Name).ToArray();
var Output = "";
var langURL = "";
foreach (string listitem in availablePageLanguages)
{
langURL = EPiServer.Web.UriUtil.AddLanguageSelection(currentPage.LinkURL, listitem);
Output += "<link href=\"" + langURL + "\" hreflang=\"" + listitem + "\" rel=\"alternate\">";
}
// Dictionary<String, String>
return new HtmlString(Output.ToString());
}
For each page I would like to get the friendly urls with the language flag as well, for example:
- /
- /de-DE
- /en-DE