I'm trying to create a custom routes for a package dynamically in a ApplicationEventHandler. I'm trying to use existing node url to form the route. However when I use the Umbraco Helper
var pageData umbracoHelper.ContentQuery.TypedContent(page.Id);
pageData.Url returns the absolute I'm trying to get the relative url to the domain.
I was thinking of an extension method which removes the host but wondered if there was a native method?
Url without Domain
Hi,
I'm trying to create a custom routes for a package dynamically in a ApplicationEventHandler. I'm trying to use existing node url to form the route. However when I use the Umbraco Helper
pageData.Url returns the absolute I'm trying to get the relative url to the domain.
I was thinking of an extension method which removes the host but wondered if there was a native method?
Hi John
It looks like "useDomainPrefixes" is set to true in your solution.
You can change it in /config/umbracoSettings.config
/Alex
Hi Alex,
"useDomainPrefixes" is set to false thanks for the suggestion. I ended up using an exension method with the following code:
John
Hi John
Thanks for sharing the solution, have a great day
/Alex
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.