Opened 7 years ago
Closed 7 years ago
#43311 closed defect (bug) (worksforme)
Missing full path to Sitemap in virtual robots.txt
Reported by: | kohlermedia | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description (last modified by )
The function witch generates the virtual robots.txt strips the path https://mydomain.com/sitemap.xml to /sitemap.xml.
Tested with
<?php add_filter( 'robots_txt', 'robots_mod', 10, 2 ); function robots_mod( $output, $public ) { $output .= "Sitemap: https://mydomain.com/sitemap.xml/\n"; return $output; }
in functions.php
sitemaps.org notes
"You can specify the location of the Sitemap using a robots.txt file. To do this, simply add the following line including the full URL to the sitemap: Sitemap: http://www.example.com/sitemap.xml"
Google search console marks a sitemap without full path as error.
Attachments (1)
Change History (2)
#1
@
7 years ago
- Description modified (diff)
- Focuses coding-standards removed
- Milestone Awaiting Review deleted
- Resolution set to worksforme
- Status changed from new to closed
- Version 4.9.4 deleted
Hello @kohlermedia, welcome to WordPress Trac!
Thanks for your report. I couldn't reproduce the issue on a clean install. In core we have no function that would replace the domain there.
Try disabling all plugins and maybe activate a default theme to find the cause for this. For additional help, please try our Support Forums.
Printscreen of google search console robots.txt tester