Open NikRimington opened 4 years ago
Thanks @NikRimington. We had a discussion around this, (at the beginning of the rebuild). Came to the conclusion that if you're building multi-tenancy sites, you probably wouldn't be using this package.
Leaving this open for discussion though... @LottePitcher @emmaburstow?
Multi-tenancy sites I've worked with have used dynamically generated site maps, to avoid the need for physical files. So yes it does look like that would be beyond the scope of this package.
I've had a multi-tenant Umbraco site that had multiple robots.txt files on disk with different names and a controller to determine which was picked. It would be cool if this package could be used to manage them. It may well be out of scope, was just an idea :-)
One easy way to address this would be to allow for special tokens, which would allow for the domain to be swapped. For example, a person could enter this line:
sitemap: https://{{domain}}/sitemap.xml
Then if a person views the robots.txt at https://www.site.com/robots.txt
, it would render as:
sitemap: https://www.site.com/sitemap.xml
So long as the XML sitemap URL is consistent across domains, this would work fine.
As somebody who built a Robots.txt package for Umbraco 7: https://our.umbraco.com/packages/developer-tools/robotnik/
I can say with some experience that I wouldn't really recommend having a different physical file for each domain. It gets cumbersome real quick (especially in my case where the web.config had to be updated for each new domain), and for no real good reason (usually just the sitemap URL changes, or the entire file changes for dev/stage/prod to allow/disallow crawling).
Having dynamic tokens would make this much easier.
Not sure how this would work yet, but if you have multiple sites in a single umbraco instance, you might need to have different robots.txt files served up and handled. Particularly for the different site maps.