I'm on Sitecore 10.2 so I don't have access to the new 10.3/XM Cloud functionality which accomplishes this out of the box.

I've implemented a robots.txt handler for Headless SXA as per this article: https://davegoosem.com/building-robots-txt-with-sitecore-jss-graphql/

It uses a custom GraphQL query to access the Settings item for the site. However, the path to that item is hardcoded.

How would I dynamically determine the context tenant and site, so that I can get the robots.txt content in a multisite implementation?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.