Page.Url and Page.GetUrlToPage gives different results?

For the root page of a Website, the obsolete Page.Url gives the full URL (http/https + domain + path) where as Page.GetUrlToPage only returns the part path (omitting http/https + domain).

How do I get the full URL for root pages with Page.GetUrlToPage? Or is this a bug?

Litium version: 6.2

To get full URL, use <page object>.GetUrlToPage(Guid.Empty, false).

Still, why do root pages and other pages behave different in this aspect?

If you are on the same website as the one you are creating a link to the link will be relative, if the page is on another website than the current one you will get a full url with schema and domain.

1 Like