Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Lee 1123 posts 3059 karma points
    Apr 25, 2013 @ 15:17
    Lee
    0

    Get Node By Hostname?

    I have an Umbraco install that runs multiple sites. So each home node has a unique hostname set.

    Is it possible to run a query to get the node back by via the hostname? I need to do this within a custom INotFoundHandler?

    Something like umbraco.library.GetNodeByHostname("www.mydomain.com") ....

  • Mads Krohn 211 posts 501 karma points c-trib
    Apr 25, 2013 @ 15:27
    Mads Krohn
    101

    Wouldn't you just go through the Domain class to get the relevant content id for the root of that domain?

    var rootId = Domain.GetRootFromDomain("domain"); // the id of the root document

    I don't think there is anything in the new API's for domain related stuff yet, or at least, I haven't seen it :)

  • Lee 1123 posts 3059 karma points
    Apr 25, 2013 @ 15:43
    Lee
    0

    Boom! Exactly what I was looking for... Thanks :)

  • Mads Krohn 211 posts 501 karma points c-trib
    Apr 25, 2013 @ 15:44
    Mads Krohn
    0

    Yay :)

  • 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.

Please Sign in or register to post replies