Add note about other redirects to next.config.js
docs. (#22640)
In case a user lands on this page via search or from Google, we should mention the other ways you can redirect with Next.js.
This commit is contained in:
parent
293c243ab7
commit
eb79218b7d
1 changed files with 5 additions and 0 deletions
|
@ -165,3 +165,8 @@ module.exports = {
|
||||||
```
|
```
|
||||||
|
|
||||||
In some rare cases, you might need to assign a custom status code for older HTTP Clients to properly redirect. In these cases, you can use the `statusCode` property instead of the `permanent` property, but not both. Note: to ensure IE11 compatibility a `Refresh` header is automatically added for the 308 status code.
|
In some rare cases, you might need to assign a custom status code for older HTTP Clients to properly redirect. In these cases, you can use the `statusCode` property instead of the `permanent` property, but not both. Note: to ensure IE11 compatibility a `Refresh` header is automatically added for the 308 status code.
|
||||||
|
|
||||||
|
## Other Redirects
|
||||||
|
|
||||||
|
- Inside [API Routes](/docs/api-routes/response-helpers.md), you can use `res.redirect()`.
|
||||||
|
- Inside [`getStaticProps`](/docs/basic-features/data-fetching.md#getstaticprops-static-generation) and [`getServerSideProps`](/docs/basic-features/data-fetching.md#getserversideprops-server-side-rendering), you can redirect specific pages at request-time.
|
||||||
|
|
Loading…
Reference in a new issue