World is now on Opti ID! Learn more
AI OnAI Off
World is now on Opti ID! Learn more
I haven't tried it, but in theory, you can implement your own HierarchicalCatalogPartialRouter, override GetCatalogContentRecursive, and check if CatalogContent is available in the current site, if not, return null which would result in a 404
I have a similar concept in a Commerce solution. Two shop brands in the same code base, each selling from their own catalog.
However, my solution also skips the catalog part from the URL. If you want to keep the catalog part of the URL, you can replace point 3 with Quan's suggestion.
This was my approach:
We are running CMS 12 / Commerce 14 on the most recent versions(as of about a month ago).
We have multiple site hosted on our CMS. We also have a Catalog with products that should only be available for one of the sites. The catalog pages work and load correctly on the site they are meant to be viewed on. We do not link to any of the catalog pages from any site other than the main site. Somehow some search engines got links to load the catalog pages on a secondary site. The catalog page should not be loadable on this site and should give a 404. The secondary site does not give a 404, it tries to load the page. And as a results it results in an exception because the secondary site does not have all of the data/functionality in place that the catalog page needs. This is producing a lot of exceptions and potentially hurting the stability of our sites/instance.
Example
This works fine and loads as it should:
This should not load, it should give a 404, but it tries to load and gives an exception:
How do i restrict the catalog to only be available for one site and not any of the others?
Thank you,
Calvin