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.
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.
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?
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
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.
Good. Must admit you got me confused ;-) Happy it's fixed!
is working on a reply...