How to Remove 301 Redirects in Sanity
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:
- Frontend framework config files:
next.config.js,astro.config.ts,vercel.json,_redirects, etc. - Hosting platform dashboard: Vercel, Netlify, or other hosting providers often have redirect settings
- CDN or proxy configurations: Check if you have any reverse proxy or CDN rules
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:
- Delete these redirect documents in Sanity Studio
- Update them to have different source and destination values
How to Fix
- Identify where redirects are configured - Check your framework's config files first (this is most likely where the issue is)
- Search for circular redirects - Look for rules where the source and destination match
- Remove or correct those redirect rules
- Redeploy your site after making changes
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.
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.