Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

External links in XML-export file


The link format in a normal page export is in permanent link format:  i.e. ~/link/f9ef91b787af4ec393c2d63aef3161fc.aspx

But is it possible to make sure that external links are outputted when doing Page Export? 

May 15, 2012 12:16


You can do something like this:

public static string RewriteUrlsToFriendly(this string input, PageData page)
    UrlBuilder internalUrl = new UrlBuilder(page.LinkURL);
    UrlBuilder externalUrl = new UrlBuilder(page.LinkURL);

    HtmlRewriteToExternal rewriter = EPiServer.Global.UrlRewriteProvider.GetHtmlRewriter();

    EPiServer.Global.UrlRewriteProvider.ConvertToExternal(externalUrl, page.PageLink, UTF8Encoding.UTF8);

    return rewriter.RewriteString(internalUrl, externalUrl, UTF8Encoding.UTF8, input);


Edited, May 15, 2012 13:29
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.