Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The module should add a reference to the sitemap to the robots.txt file. A line in this form should be added:
Sitemap: http://www.example.com/sitemap.xml
Comments
Comment #2
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedrobots.txt is a file on disk that is most likely write-protected in a lot of hosting environments. Given this file ships with core, it would usually be up to the developer of a project to update the file, create a patch for the file and ship that along with the rest of the project.
I can't see this easily fitting into the module and modifying core files that are on-disk isn't something I've seen a lot of.
Comment #3
Liam MorlandI thought xmlsitemap already did this, so simple_sitemap could use the same technique. If not, then it may not be feasible.
Comment #4
gbyte CreditAttribution: gbyte as a volunteer and commentedXmlsitemap hooks into the contrib robotstxt module and alters the file's output. This can be implemented fairly easily but is not a priority ATM. I may look into it soon, until then happy to review patches.
Comment #6
gbyte CreditAttribution: gbyte as a volunteer and commentedI've finally found the time to add this feature. Please reopen if you find any problems with the implementation.
Comment #7
heddnI don't think it would support if drupal is installed in a sub folder of the hostname i.e. example.com/drupal/sitemap.xml. I'll open a follow-up.
Comment #8
heddn#2855975: Support RobotsTxt module in sub folder installations is now open.