HTTP addresses, HTTPS pages with www, and a new domain without www were found in one sitemap. Often the cause is multiple sources for the full address: CMS settings, imports, and cache. Choose a primary domain and HTTPS, then check that each page corresponds to it. Simply replacing the domain in every line can create nonexistent URLs.
Choose the site's primary address
Google recommends using full URLs of the selected canonical pages in a sitemap. Official documentation.
Choosing https://example.com as the primary address should be an explicit decision by the site owner. The www alternative can redirect to it, but a separate old.example.com may contain a different project. Make a list of the hosts belonging to the site and their roles. For each one, determine whether it is a version of the same content, a historical domain, or a separate property. Change the domain only for pages whose new version has been confirmed. The path /service/ on two different projects does not, by itself, prove that the pages correspond to each other.
Four versions of one entry
| Address version | Why it differs | Which URL to choose | What to compare with canonical |
|---|---|---|---|
| http://example.com/a/ | Old protocol | Check the HTTPS equivalent | Preserve the path |
| https://www.example.com/a/ | Alternative host | Choose the primary form | Check that the redirect preserves the path |
| https://example.com/a/ | Selected address | Check the content | Canonical points to this same URL |
| https://old.example/a/ | Another source | Confirm that it corresponds | Do not replace blindly |
Check the final page
For test addresses, follow the redirect chain and compare the final content. Record the HTTPS destination's status, certificate, and canonical. If HTTP redirects to HTTPS without preserving the path, the problem is not limited to the sitemap. If the www page remains separate and has different content, review the site architecture first. Do not treat an identical main heading (H1) as proof that the pages fully correspond: the product or language may have changed. For removed pages, choose a separate solution rather than creating an entry for a new URL that also returns an error.
Ask a developer to follow the redirect chain for one selected page with this command in the terminal.
curl -sS -L --max-redirs 10 -D headers.txt -o response.html 'http://example.com/a/'The request will preserve the entire redirect chain in headers.txt, because -L is specified. Look for each Location and the final status; the last page will be in response.html. Compare its domain and protocol with the sitemap address in loc and the page's preferred address in canonical. Replace example.com with your domain; this GET request does not change the site settings. curl documentation.
Consolidate only identical pages
The sample list contains http://example.com/a/, https://www.example.com/a/ and https://example.com/a/. After confirming that they are equivalent, they can lead to one selected loc. The fourth entry, https://old.example/a/, refers to a different service and requires separate consideration. Save the original list before making replacements. After generating the new sitemap, compare it with the original: the three identical versions /a/ should become one entry, the other project should remain separate, and the removed page should disappear. If an active service is missing, check its entry in the CMS.
Fix the domain in the CMS and imports
Ask a developer to check the CMS base address, the generator's launch settings, saved absolute links, and import settings. Changing one global setting may not fix an address stored in a separate SEO field. For child sitemaps, find out whether they use a shared domain source. Manual XML edits will disappear the next time the sitemap is built, so fix the configuration or data instead. Then run the normal build and make a public GET request again. If the sitemap is cached separately, compare its update time with the settings release so you do not mistake an old response for a failed fix.
Open the old and new URLs
The new sitemap contains the selected HTTPS version of the page. Old HTTP/www entry points preserve the path and lead to the same content. Another project has not been replaced just because it has a similar /a/. Sitemaps intentionally hosted on another domain require a separate check against the search engine's requirements.
Read also: How to redirect from HTTP to HTTPS (Apache, Nginx, WordPress) and Conflicts between canonical, sitemap, hreflang, and redirects. Site checks are available on the reChecker technical audit page.