Try our conversational search powered by Generative AI!

Get simple address for page


I want to get the simple address for a given page. So far, I've come up with the code below, which obviously don't work. Can someone please help me? Thanks!


protected string SimpleAddress(PageData page)
UrlBuilder ub = new UrlBuilder(page.LinkURL);
EPiServer.Global.UrlRewriteProvider.ConvertToExternal(ub, page.PageLink, System.Text.UTF8Encoding.UTF8);
string url = ub.ToString();

return url;
Jul 09, 2008 16:38

Seems I was pointed in the wrong direction before. Of course you can access the simple address through the propertyname "PageExternalUrl".

Howeve, the url looks like this:


instead of:


meaning the PageExternalUrl looks for the folder structure and then adds the simple url..

How can you solve this in an appropriate way? 

Jul 09, 2008 17:22

Hi Martin!

I did a quick test and the PageExternalUrl property

string s = page["PageExternalUrl"] 

and it returned the expected value, which in your case would be "sitemap".

So all you should need to do is something like the following to get an the complete url:

Configuration.Settings.Instance.SiteUrl.ToString() + page["PageExternalUrl"];


Per Gunsarfs

Jul 10, 2008 13:20

Here is a sample code snippet for retrieving the simple address for a page:

Aug 15, 2008 10:52

Martin, the reason for your inaccurate URL is that the simple address doesn't include a leading slash by default.

Aug 15, 2008 11:14
* 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.