How AI is powering better personalization in e-commerce [with Vercel]. Sign up now

How to remove 301 redirects in Sanity when original and redirect URLs match?

1 replyLast updated: Nov 29, 2025

Hi! I pulled out a SEO-report with the links on our site and I see that numerous sites are not indexable, which we would love to fix to get more organic traffic to our site. We see that most of them are due to a redirect 301. How do we remove the redirects in Sanity? From what we can see the original URL and redirect URL are the same.
AI Update

Based on your question, I need to clarify something important: Sanity itself doesn't create or manage 301 redirects - these are handled by your frontend framework or hosting platform, not by Sanity CMS.

Understanding the Issue

If you're seeing 301 redirects where the original URL and redirect URL are the same, this is causing a redirect loop. This configuration exists in your frontend code or hosting settings, not in Sanity. Common places to check:

If You're Using Sanity to Store Redirect Data

Some teams use Sanity to store redirect information as structured content, which is then consumed by their frontend. If you've implemented this pattern (described in this guide), here's how to find problematic redirects:

Query your Sanity dataset to find redirects where the source and destination are identical:

*[_type == "redirect" && from.current == to.current]

Then either:

How to Fix

Key Takeaway

Sanity is a content management system that can store redirect data, but your frontend framework or hosting platform actually implements the redirects. The 301 responses are coming from your web server/hosting layer, not from Sanity. You'll need to fix the configuration at that level to resolve the redirect loops affecting your SEO.

Show original thread
1 reply

Was this answer helpful?

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Related contributions