Search code examples
c#sitefinitysitefinity-10

Find URL scheme and hostname in Sitefinity controller


I cannot find how to get the scheme and hostname of the URL for my site. I don't see a matching setting in the App_Data/Sitefinity/Configuration/*.config files, and nothing else is jumping out at me in the code or the documentation for this.

I'm trying to construct some absolute URLs from relative URLs being fed in from a 3rd party - and we have multiple environments, each with its own hostname.


Solution

  • Found it!

    SystemManager.CurrentContext.CurrentSite.LiveUrl