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

Liam Morland created an issue. See original summary.

Sam152’s picture

robots.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.

Liam Morland’s picture

I thought xmlsitemap already did this, so simple_sitemap could use the same technique. If not, then it may not be feasible.

gbyte’s picture

Title: Add sitemap to robots.txt » Support RobotsTxt module

Xmlsitemap 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.

  • gbyte.co committed 2dcacab on 8.x-2.x
    Issue #2784079 by liam-morland: Support RobotsTxt module
    
gbyte’s picture

Status: Active » Fixed

I've finally found the time to add this feature. Please reopen if you find any problems with the implementation.

heddn’s picture

I 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.

heddn’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.