8000 Docs IA 2.0: Move Redirects page to guides (#79447) · vercel/next.js@63ed70b · GitHub
[go: up one dir, main page]

Skip to content

Commit 63ed70b

Browse files
Docs IA 2.0: Move Redirects page to guides (#79447)
Closes: https://linear.app/vercel/issue/DOC-4695/guide-redirects Redirects: vercel/front#46041
1 parent bcb38e4 commit 63ed70b

File tree

7 files changed

+11
-9
lines changed

7 files changed

+11
-9
lines changed

docs/01-app/02-guides/authentication.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ export async function createSession(userId) {
672672
}
673673
```
674674
675-
Back in your Server Action, you can invoke the `createSession()` function, and use the [`redirect()`](/docs/app/building-your-application/routing/redirecting) API to redirect the user to the appropriate page:
675+
Back in your Server Action, you can invoke the `createSession()` function, and use the [`redirect()`](/docs/app/guides/redirecting) API to redirect the user to the appropriate page:
676676
677677
```ts filename="app/actions/auth.ts" switcher
678678
import { createSession } from '@/app/lib/session'
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
title: Redirecting
2+
title: How to handle redirects in Next.js
3+
nav_title: Redirecting
34
description: Learn the different ways to handle redirects in Next.js.
45
related:
56
links:

docs/01-app/03-building-your-application/01-routing/04-linking-and-navigating.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export default async function Profile({ params }) {
142142
> - `redirect` internally throws an error so it should be called outside of `try/catch` blocks.
143143
> - `redirect` can be called in Client Components during the rendering process but not in event handlers. You can use the [`useRouter` hook](#userouter-hook) instead.
144144
> - `redirect` also accepts absolute URLs and can be used to redirect to external links.
145-
> - If you'd like to redirect before the render process, use [`next.config.js`](/docs/app/building-your-application/routing/redirecting#redirects-in-nextconfigjs) or [Middleware](/docs/app/building-your-application/routing/redirecting#nextresponseredirect-in-middleware).
145+
> - If you'd like to redirect before the render process, use [`next.config.js`](/docs/app/guides/redirecting#redirects-in-nextconfigjs) or [Middleware](/docs/app/guides/redirecting#nextresponseredirect-in-middleware).
146146
147147
See the [`redirect` API reference](/docs/app/api-reference/functions/redirect) for more information.
148148

docs/01-app/03-building-your-application/01-routing/05-error-handling.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ You could also use the returned state to display a toast message from the Client
109109
110110
### Handling Expected Errors from Server Components
111111
112-
When fetching data inside of a Server Component, you can use the response to conditionally render an error message or [`redirect`](/docs/app/building-your-application/routing/redirecting#redirect-function).
112+
When fetching data inside of a Server Component, you can use the response to conditionally render an error message or [`redirect`](/docs/app/guides/redirecting#redirect-function).
113113
114114
```tsx filename="app/page.tsx" switcher
115115
export default async function Page() {

docs/01-app/05-api-reference/02-components/form.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ export default function Page() {
333333
}
334334
```
335335

336-
After a mutation, it's common to redirect to the new resource. You can use the [`redirect`](/docs/app/building-your-application/routing/redirecting) function from `next/navigation` to navigate to the new post page.
336+
After a mutation, it's common to redirect to the new resource. You can use the [`redirect`](/docs/app/guides/redirecting) function from `next/navigation` to navigate to the new post page.
337337

338338
> **Good to know**: Since the "destination" of the form submission is not known until the action is executed, `<Form>` cannot automatically prefetch shared UI.
339339

docs/01-app/05-api-reference/04-functions/unstable_rethrow.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ export default async function Page() {
4646
The following Next.js APIs rely on throwing an error which should be rethrown and handled by Next.js itself:
4747

4848
- [`notFound()`](/docs/app/api-reference/functions/not-found)
49-
- [`redirect()`](/docs/app/building-your-application/routing/redirecting#redirect-function)
50-
- [`permanentRedirect()`](/docs/app/building-your-application/routing/redirecting#permanentredirect-function)
49+
- [`redirect()`](/docs/app/guides/redirecting#redirect-function)
50+
- [`permanentRedirect()`](/docs/app/guides/redirecting#permanentredirect-function)
5151

5252
If a route segment is marked to throw an error unless it's static, a Dynamic API call will also throw an error that should similarly not be caught by the developer. Note that Partial Prerendering (PPR) affects this behavior as well. These APIs are:
5353

< 6D26 th scope="col">Diff line change
Original file line numberDiff line number
@@ -1,7 +1,8 @@
11
---
2-
title: Redirecting
2+
title: How to handle redirects in Next.js
3+
nav_title: Redirecting
34
description: Learn the different ways to handle redirects in Next.js.
4-
source: app/building-your-application/routing/redirecting
5+
source: app/guides/redirecting
56
---
67

78
{/* DO NOT EDIT. The content of this doc is generated from the source above. To edit the content of this page, navigate to the source page in your editor. You can use the `<PagesOnly>Content</PagesOnly>` component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */}

0 commit comments

Comments
 (0)
0