When migrating a website’s domain to a new domain, it’s important to check that the URLs in the old domain’s sitemap are redirecting 1:1 to the corresponding pages on the new domain. This helps ensure that search engines continue to crawl and index the site’s pages, even after the domain has changed and visitors can reach the right page on the new domain.
To make this process easier, I’ve created a script that can automatically check the redirects of URLs in a sitemap file or URL based on old and new domains. The script takes two parameters: the file path or URL of the old sitemap and the new domain.
verify_sitemap_urls {path_or_url_to_old_sitemap_file} {new_domain}
Here is the script:
As a side effect this will also warm up the cache.
Leave a Reply