Don't miss out Virtual Happy Hour this Friday (April 26).
Try our conversational search powered by Generative AI!
AI OnAI Off
Don't miss out Virtual Happy Hour this Friday (April 26).
Hi M,
you could try this:
public static string GetFriendlyUrl(PageData page)
{
UrlBuilder url = new UrlBuilder(page.LinkURL);
url.QueryLanguage = page.LanguageBranch;
EPiServer.Global.UrlRewriteProvider.ConvertToExternal(
url,
page.PageLink,
UTF8Encoding.UTF8);
return url.ToString();
}
Thansks, but I've tried that. If current page has short url given I get the short url not the "friendly-long-url".... maybe its because of custom made urlprovider in my case... i'll have to look into that... thanks!
Oh, I see. However, in a standard 6 R2 site, the "GetFriendlyUrl" method I posted should still return the friendly url, and not the simple address. So yeah, checking custom code would probably be a step in the right direction :-)
It's also possible to turn of simple addresses, byt setting enableSimpleAddress="false" in web.config.
Hello
I have a copule of pages that have short urls given on them (page.Property["PageExternalUrl"]) now I'm in a situation where I need to get the "long friendly external url" (normal freindly url you get when short url is empty) programmaticly. Is there a way to get this url from pagedata object in a "good performance way" when you have given short url of given page?
/M