Redirect sitemap.xml to wp-sitemap.xml if about to return a 404 #149
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
Included part of a route I opted not to take.
Noting from today's Slack meeting, this PR is on ice until we settle on the URL format. If we keep |
should we also remove the 0.3.0 milestone? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, do we want any tests here? @swissspidy
If it's possible, sure. But let's wait first whether we actually keep the |
@kraftbj just an FYI that last week we decided to stick with Do you think we can add a test here? WP core itself doesn't test handle_404, so maybe it's not easily doable. |
Will pick this back up and see what I can out together. |
Merging this one for now as it works as expected. Not critical to have a test for an HTTP redirect, but could always be added in a new PR. |
Issue Number
Fixes #144
Description
sitemap.xml
is a common location of a site's sitemap. In instances where there is not an existing sitemap.xml either on the file system or served by another plugin, the Core WP-Sitemaps plugin will redirect to the wp-sitemap.xml URL to help improve discoverability and allowed those who have submittedsitemap.xml
to search engines to be able to drop-in without change.Type of change
Please select the relevant options:
Steps to test
wp-sitemap.xml
Acceptance criteria