I have 2 languages added to my site, Swedish and Danish. I've created a start page as root node for my content and added 2 domains in Cultures and Hostname, /da and /sv.
If I look at the route for the route for the content for the Swedish start page, it says /sv/.
I'm using UmbracoContext.Content.GetByRoute, in order to find the content. I need to pass (preview: false, route: "/", culture: "sv") in order to find it. Why is /sv omitted from the route?
I've also seen examples of the domain root id needing to be a prefix for the route, e.g. 1056/sv/, does that only apply for multiple root nodes?
Get content by route with multiple domains
I have 2 languages added to my site, Swedish and Danish. I've created a start page as root node for my content and added 2 domains in Cultures and Hostname,
/da
and/sv
.If I look at the route for the route for the content for the Swedish start page, it says
/sv/
.I'm using
UmbracoContext.Content.GetByRoute
, in order to find the content. I need to pass(preview: false, route: "/", culture: "sv")
in order to find it. Why is/sv
omitted from the route?I've also seen examples of the domain root id needing to be a prefix for the route, e.g.
1056/sv/
, does that only apply for multiple root nodes?Thanks in advance :)
Hi Johan
What Umbraco version are you using? Are you using "addTrailingSlash" setting?
Check that you don't have rewrite rules that change URL and custom URL providers.
Thanks,
Alex
Hi Alex,
I use Umbraco v8.12.1 and I haven't modified umbracoSettings.config, so I don't think
addTrailingSlash
is enabled?I do have a custom content finder added first to the content finder chain though, could that affect
UmbracoContext.Content.GetByRoute
?My rewrite rules are for UCommerce:
is working on a reply...