Vercel Redirect Generator
Create valid vercel.json redirect configurations including regex path matching and query string evaluations.
Vercel Redirect Config
Generate JSON configuration for standard, wildcard, and query-based routing in Vercel.
Rule Builder
vercel.json
How do Vercel Redirects work?
Vercel handles redirects natively at the Edge. This means redirects happen incredibly fast before any of your Serverless Functions or static files are hit.
To configure redirects, you can use a vercel.json file in the root of your repository. If you are using a framework like Next.js, Nuxt, or SvelteKit, you can also define redirects within their respective configuration files (e.g. next.config.js). The JSON syntax generated by this tool is specifically for vercel.json.
Important Vercel specific behaviors:
- Permanent Redirects (308 vs 301): Vercel uses the modern HTTP
308 Permanent Redirectstatus code for permanent redirects instead of301, and307 Temporary Redirectinstead of302. 308 and 307 are preferred because they strictly preserve the HTTP method (e.g., a POST request won't accidentally be downgraded to a GET). - PCRE Regex: Vercel uses PCRE (Perl Compatible Regular Expressions) for the
sourcepath. This allows powerful routing like capture groups/(.*)or named capture groups/(?<id>.*). - Query Strings: Unlike traditional servers (Nginx/Apache), query strings are evaluated separately using the
hasormissingarray properties, making it very easy to redirect based on the presence of a specific?key=valuepair.
Related Guides
Deepen your understanding with our expert articles.
