#permanent` is not set to `true` or `false` for route {"source":"/api/:path*","destination":"https://
1 messages · Page 1 of 1 (latest)
The permanent property in the route configuration is optional and is used to toggle between permanent and temporary redirects. By default, it is set to true. When permanent is set to true, the status code for the redirect is 308. When it's set to false, the status code is 307.
Here is an example of how you can set the permanent property in your route configuration:
{
"source": "/api/:path*",
"destination": "<https://example.com/:path*",>
"permanent": true
}
In this example, any request to /api/:path* will be permanently redirected to <https://example.com/:path*> with a status code of 308.
If you need to use a status code other than 307 or 308, you can use the statusCode property instead of permanent. However, you cannot use both permanent and statusCode in the same route configuration.
Sources:
- Vercel Docs - Redirect Object Definition (https://vercel.com/docs/projects/project-configuration#redirect-object-definition)
- Next.js Docs - Redirects (https://nextjs.org/docs/pages/api-reference/next-config-js/redirects)
- Vercel Guide - Does Vercel support permanent redirects? (https://vercel.com/guides/does-vercel-support-permanent-redirects#in-application-redirects)