Try our conversational search powered by Generative AI!

Catalog routing language issues

Vote:
 

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
https://www.example.se/kategori1/
https://www.example.com/category1/

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
https://www.example.com/sv/kategori1/


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 https://www.example.com/sv/kategori1/
So basically I need som tips on where to start digging.

#276503
Mar 17, 2022 9:07
Vote:
 

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.

#276660
Mar 18, 2022 7:51
Vote:
 

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.

#276803
Mar 21, 2022 15:08
Vote:
 

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!

#276854
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.