Skip to content

Sitemap URLs point to redirects

Sitemap URLs should point directly to the final, canonical version of each page. If an entry redirects, Googlebot must follow the redirect before it can process the page. This wastes a small amount of crawl budget on each request, but more importantly it signals that your sitemap is out of sync with your actual URL structure.

Update each redirecting sitemap entry to use the final destination URL directly.

First, identify which URLs are redirecting:

Terminal window
orino audit --url https://yourdomain.com

For each flagged URL, trace where it ends up:

Terminal window
curl -IL --max-redirs 10 https://yourdomain.com/old-path

Use the final Location: value as the updated sitemap entry.

Edit sitemap.xml and replace the old URL with the final destination:

<!-- Before -->
<url>
<loc>https://yourdomain.com/old-path</loc>
</url>
<!-- After -->
<url>
<loc>https://yourdomain.com/new-path</loc>
</url>

Update the URLs returned by app/sitemap.ts to use the current canonical paths:

app/sitemap.ts
export default function sitemap() {
return [
{
url: 'https://yourdomain.com/new-path', // previously /old-path
lastModified: new Date(),
},
]
}

Update the data source in your src/routes/sitemap.xml/+server.ts endpoint to use current slugs.

Update the data source your sitemap configuration reads from. If slugs changed in your CMS, update the generator to use the new values.

After updating, confirm each previously-redirecting URL now resolves directly to 200:

Terminal window
curl -o /dev/null -s -w "%{http_code}" https://yourdomain.com/new-path

Re-run orino audit to confirm the check passes.