
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeThis is a common issue when deploying Sanity Studio to Netlify! The problem is that Sanity Studio is a single-page application (SPA), and when you navigate to routes like /desk, Netlify tries to find an actual file at that path instead of serving your index.html file.
The solution is to add a _redirects file to tell Netlify to serve your index.html for all routes. Here's how to fix it:
Create a file called _redirects (no file extension) in your Studio's public folder with this content:
/* /index.html 200
This tells Netlify to serve your index.html file for all routes (the /* wildcard) with a 200 status code, which allows the Studio's client-side routing to handle the navigation properly.
The location depends on your setup:
public/_redirects in your Studio directorystudio/public/_redirects (or wherever your Studio lives)The public folder's contents get copied to the build output when you run sanity build, so the _redirects file will end up in your dist folder where Netlify can read it.
Make sure your Netlify configuration is correct:
sanity build (or npm run build if you've set up a build script)dist (or studio/dist for monorepos)Single-page applications like Sanity Studio use client-side routing, meaning routes like /desk don't correspond to actual files on the server. Without the redirect rule, Netlify looks for a file called desk and returns a 404 when it doesn't find one. The _redirects file tells Netlify to always serve the index.html, which then loads the Studio JavaScript that handles the routing.
After deploying with this change, navigating directly to /desk or any other Studio route should work correctly in all browsers!
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.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store