Try our conversational search powered by Generative AI!

Catalog routing language issues


Hello! I'm having an issue with catalog routing that I can't seem to resolve.

We have multiple page trees in different languages, each language is tied to a different market, but all sites are using the same catalog.

So we have for example this setup where this is the same category, but in different languages and markets

But if I add language segment to the url I can still hit the swedish products on the english site even though swedish is not enabled for the website

For SEO reasons we would Ideally like this to be a 404.
Any ideas on how to acvieve this?

I've been messing around with catalog routing, my idea was returning null in the RoutePartial on some sort of condition would fix this, but RoutePartial is never hit when visiting this url
So basically I need som tips on where to start digging.

Mar 17, 2022 9:07

Maybe this is something that can be reported to support as a bug? It seems to me like catalog content is loaded in wrong language context.

Mar 18, 2022 7:51

I don't know about the routing in Commerce, but if you render a canoncial link "@Html.CanonicalLink()" you shouldn't need to worry about duplicated content.

Mar 21, 2022 15:08

I'm using Jetbrains Rider and my feeling is that it's much better on debugging decompiled Episerver code, not sure about Visual Studio. Anyway, if you can debug decompiled code - I would try to put breakpoints in any class within the namespace EPiServer.Web.Routing.Segments.Internal - for example RequestSegmentContext, PartialSegment, NodeSegment, LanguageSegment and LanguageSegmentMatcher. This should allow you to figure out how Episerver resolves the content for some URL.

Nice mustache btw!

Mar 22, 2022 11:34
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.