rsnext/docs
Shohei Maeda efd8d22654
Add new permanentRedirect function in App Router (#54047)
for internal:
https://vercel.slack.com/archives/C03S8ED1DKM/p1691700057242999

### Problem

- The existing [`redirect()`
function](https://nextjs.org/docs/app/api-reference/functions/redirect)
can't control the status code.
- The existing [`redirect()`
function](https://nextjs.org/docs/app/api-reference/functions/redirect)
returns a 307 HTTP redirect response while it returns a 308-equivalent
meta tag `<meta http-equiv="refresh" content="0;url=/foo"/>` in
streaming response (e.g., suspense boundary), making the behavior
inconsistent.

### Solution

Adding a new `permanentRedirect()` function and changing the meta tag
default accordingly.

| func   |      HTTP status      |  meta tag |
|---|:---:|---|
| `redirect()` | 307 | `<meta http-equiv="refresh"
content="1;url=/foo"/>` |
| `permanentRedirect()` | 308 | `<meta http-equiv="refresh"
content="0;url=/foo"/>` |

ref.
https://developers.google.com/search/docs/crawling-indexing/301-redirects

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-08-28 14:22:43 -07:00
..
01-getting-started Docs: Fix formatting issues in the rendering docs (#54517) 2023-08-24 16:49:46 +00:00
02-app Add new permanentRedirect function in App Router (#54047) 2023-08-28 14:22:43 -07:00
03-pages docs: Forms and mutations (#54314) 2023-08-25 14:31:11 -05:00
04-architecture fix(next): clarify fetch polyfill, drop node-fetch (#53548) 2023-08-03 23:12:26 +00:00
05-community Docs: Fix broken links (#54340) 2023-08-21 16:33:38 +00:00
index.mdx docs: Rewrite Rendering Section and React Essentials Page (#51579) 2023-08-24 08:48:44 -05:00