Copied to clipboard

Flag this post as spam?

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


  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jul 11, 2013 @ 12:23
    Anthony Dang
    0

    6.0.6, .Url gets absolute url to a page (with same name) in another site in the instance.

    Hey

     

    My issue is that node.Url gives me the absolute url of another domain

    My setup:

    Global - domain.local
    UK - uk.domain.local
    US - us.domain.local

    The UK site is virtually identical to the US site so they both have /about/ pages

    Assume I'm on us.domain.local..
    var node = Umbraco.TypedContent(123); // bet about page

    All give me uk.domain.local/about
    node.Url
    node.Url()
    node.UrlWithDomain()
    node.NiceUrl()

    I would assume it would give me /about.

    Is there a quick fix or a config setting I'm missing?

     

     

  • Stephen 767 posts 2273 karma points c-trib
    Jul 11, 2013 @ 12:48
    Stephen
    0

    First, node.Url, .Url(), .UrlWithDomain(), .NiceUrl()... all end up running the same code, so at least that is consistent, and all those methods should return the same value.

    Next, if you're browsing http://us.domain.local, and node 123 is under "US", and domain "us.domain.local" has been configured on node "US"... then you should get "/about" (can be relative) or "http://us.domain.local/about" (if you set useDomainPrefixes I think it will create abs. urls). Not sure why it would start picking the UK domain.

    What's the value of useDomainPrefixes config?

    Stephan

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jul 11, 2013 @ 23:37
    Anthony Dang
    0

    dammit!... i made a major rookie mistake...

    it turns out that when i copied the tree, i didn't re-select all the nav items etc. I even had the root node pointing to the home node of the previous tree.

    *slapping myself across the face*

    Thanks for your quick feedback though. It did point me in the right direction.

     

  • Stephen 767 posts 2273 karma points c-trib
    Jul 12, 2013 @ 10:01
    Stephen
    0

    Good. Must admit you got me confused ;-) Happy it's fixed!

Please Sign in or register to post replies

Write your reply to:

Draft