You can convert between internal and external urls by using the UrlRewriteProvider:
You can get the current provider through the Global class in code:
EPiServer.Global.UrlRewriteProvider.ConvertToExternal(new UrlBuilder(myUrl), null, Encoding.UTF8);
I've tried using that but all I get is "True". I'm pretty sure I'm using it wrong.
Sorry, was a bit quick with the code sample there, try this:
var ub = new UrlBuilder(internalUrl);
EPiServer.Global.UrlRewriteProvider.ConvertToExternal(ub, null, Encoding.UTF8);
string externalUrl = ub.ToString();
The true value you get means that the conversion was successful.
PageReference tellFriendPageRef = CurrentPage["TellFriend"] as PageReference;
if (tellFriendPageRef != null)
PageData tellFriendPage = GetPage(tellFriendPageRef);
tellFriendPageUrl = tellFriendPage.LinkURL;