diff --git a/docs/01-app/01-getting-started/01-installation.mdx b/docs/01-app/01-getting-started/01-installation.mdx
index e3f055c5ebbad..e86216945cc7b 100644
--- a/docs/01-app/01-getting-started/01-installation.mdx
+++ b/docs/01-app/01-getting-started/01-installation.mdx
@@ -242,7 +242,7 @@ Now, when editing files, the custom plugin will be enabled. When running `next b
-See the [TypeScript configuration](/docs/app/api-reference/next-config-js/typescript) page for more information on how to use TypeScript in your project.
+See the [TypeScript configuration](/docs/app/api-reference/config/next-config-js/typescript) page for more information on how to use TypeScript in your project.
## Set up ESLint
@@ -280,7 +280,7 @@ If either of the two configuration options are selected, Next.js will automatica
You can now run `next lint` every time you want to run ESLint to catch errors. Once ESLint has been set up, it will also automatically run during every build (`next build`). Errors will fail the build, while warnings will not.
-See the [ESLint Plugin](/docs/app/api-reference/next-config-js/eslint) page for more information on how to configure ESLint in your project.
+See the [ESLint Plugin](/docs/app/api-reference/config/next-config-js/eslint) page for more information on how to configure ESLint in your project.
## Set up Absolute Imports and Module Path Aliases
diff --git a/docs/01-app/01-getting-started/02-project-structure.mdx b/docs/01-app/01-getting-started/02-project-structure.mdx
index 7369d5daa28ef..4bdf2129d14d3 100644
--- a/docs/01-app/01-getting-started/02-project-structure.mdx
+++ b/docs/01-app/01-getting-started/02-project-structure.mdx
@@ -34,7 +34,7 @@ Top-level files are used to configure your application, manage dependencies, run
| | |
| ------------------------------------------------------------------------------------------- | --------------------------------------- |
| **Next.js** | |
-| [`next.config.js`](/docs/app/api-reference/next-config-js) | Configuration file for Next.js |
+| [`next.config.js`](/docs/app/api-reference/config/next-config-js) | Configuration file for Next.js |
| [`package.json`](/docs/app/getting-started/installation#manual-installation) | Project dependencies and scripts |
| [`instrumentation.ts`](/docs/app/building-your-application/optimizing/instrumentation) | OpenTelemetry and Instrumentation file |
| [`middleware.ts`](/docs/app/building-your-application/routing/middleware) | Next.js request middleware |
diff --git a/docs/01-app/02-building-your-application/01-routing/07-redirecting.mdx b/docs/01-app/02-building-your-application/01-routing/07-redirecting.mdx
index 36c901d69bc93..3a0a8de49c259 100644
--- a/docs/01-app/02-building-your-application/01-routing/07-redirecting.mdx
+++ b/docs/01-app/02-building-your-application/01-routing/07-redirecting.mdx
@@ -6,7 +6,7 @@ related:
- app/api-reference/functions/redirect
- app/api-reference/functions/permanentRedirect
- app/building-your-application/routing/middleware
- - app/api-reference/next-config-js/redirects
+ - app/api-reference/config/next-config-js/redirects
---
There are a few ways you can handle redirects in Next.js. This page will go through each available option, use cases, and how to manage large numbers of redirects.
@@ -233,7 +233,7 @@ See the [`useRouter` API reference](/docs/pages/api-reference/functions/use-rout
The `redirects` option in the `next.config.js` file allows you to redirect an incoming request path to a different destination path. This is useful when you change the URL structure of pages or have a list of redirects that are known ahead of time.
-`redirects` supports [path](/docs/app/api-reference/next-config-js/redirects#path-matching), [header, cookie, and query matching](/docs/app/api-reference/next-config-js/redirects#header-cookie-and-query-matching), giving you the flexibility to redirect users based on an incoming request.
+`redirects` supports [path](/docs/app/api-reference/config/next-config-js/redirects#path-matching), [header, cookie, and query matching](/docs/app/api-reference/config/next-config-js/redirects#header-cookie-and-query-matching), giving you the flexibility to redirect users based on an incoming request.
To use `redirects`, add the option to your `next.config.js` file:
@@ -258,7 +258,7 @@ module.exports = {
}
```
-See the [`redirects` API reference](/docs/app/api-reference/next-config-js/redirects) for more information.
+See the [`redirects` API reference](/docs/app/api-reference/config/next-config-js/redirects) for more information.
> **Good to know**:
>
diff --git a/docs/01-app/02-building-your-application/01-routing/13-route-handlers.mdx b/docs/01-app/02-building-your-application/01-routing/13-route-handlers.mdx
index 9813880eb1e85..1bce5f603356d 100644
--- a/docs/01-app/02-building-your-application/01-routing/13-route-handlers.mdx
+++ b/docs/01-app/02-building-your-application/01-routing/13-route-handlers.mdx
@@ -508,7 +508,7 @@ export async function GET(request) {
> **Good to know**:
>
-> - To add CORS headers to multiple Route Handlers, you can use [Middleware](/docs/app/building-your-application/routing/middleware#cors) or the [`next.config.js` file](/docs/app/api-reference/next-config-js/headers#cors).
+> - To add CORS headers to multiple Route Handlers, you can use [Middleware](/docs/app/building-your-application/routing/middleware#cors) or the [`next.config.js` file](/docs/app/api-reference/config/next-config-js/headers#cors).
> - Alternatively, see our [CORS example](https://github.com/vercel/examples/blob/main/edge-functions/cors/lib/cors.ts) package.
### Webhooks
diff --git a/docs/01-app/02-building-your-application/02-data-fetching/03-server-actions-and-mutations.mdx b/docs/01-app/02-building-your-application/02-data-fetching/03-server-actions-and-mutations.mdx
index 291b854c95ce0..46b8c1200af1a 100644
--- a/docs/01-app/02-building-your-application/02-data-fetching/03-server-actions-and-mutations.mdx
+++ b/docs/01-app/02-building-your-application/02-data-fetching/03-server-actions-and-mutations.mdx
@@ -5,7 +5,7 @@ description: Learn how to handle form submissions and data mutations with Next.j
related:
description: Learn how to configure Server Actions in Next.js
links:
- - app/api-reference/next-config-js/serverActions
+ - app/api-reference/config/next-config-js/serverActions
---
[Server Actions](https://react.dev/reference/rsc/server-actions) are **asynchronous functions** that are executed on the server. They can be called in Server and Client Components to handle form submissions and data mutations in Next.js applications.
@@ -970,7 +970,7 @@ Behind the scenes, Server Actions use the `POST` method, and only this HTTP meth
As an additional protection, Server Actions in Next.js also compare the [Origin header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin) to the [Host header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Host) (or `X-Forwarded-Host`). If these don't match, the request will be aborted. In other words, Server Actions can only be invoked on the same host as the page that hosts it.
-For large applications that use reverse proxies or multi-layered backend architectures (where the server API differs from the production domain), it's recommended to use the configuration option [`serverActions.allowedOrigins`](/docs/app/api-reference/next-config-js/serverActions) option to specify a list of safe origins. The option accepts an array of strings.
+For large applications that use reverse proxies or multi-layered backend architectures (where the server API differs from the production domain), it's recommended to use the configuration option [`serverActions.allowedOrigins`](/docs/app/api-reference/config/next-config-js/serverActions) option to specify a list of safe origins. The option accepts an array of strings.
```js filename="next.config.js"
/** @type {import('next').NextConfig} */
diff --git a/docs/01-app/02-building-your-application/02-data-fetching/04-incremental-static-regeneration.mdx b/docs/01-app/02-building-your-application/02-data-fetching/04-incremental-static-regeneration.mdx
index ea3d174e99174..142dcc9cbd770 100644
--- a/docs/01-app/02-building-your-application/02-data-fetching/04-incremental-static-regeneration.mdx
+++ b/docs/01-app/02-building-your-application/02-data-fetching/04-incremental-static-regeneration.mdx
@@ -543,7 +543,7 @@ You can configure the Next.js cache location if you want to persist cached pages
### Debugging cached data in local development
-If you are using the `fetch` API, you can add additional logging to understand which requests are cached or uncached. [Learn more about the `logging` option](/docs/app/api-reference/next-config-js/logging).
+If you are using the `fetch` API, you can add additional logging to understand which requests are cached or uncached. [Learn more about the `logging` option](/docs/app/api-reference/config/next-config-js/logging).
```jsx filename="next.config.js"
module.exports = {
diff --git a/docs/01-app/02-building-your-application/03-rendering/04-partial-prerendering.mdx b/docs/01-app/02-building-your-application/03-rendering/04-partial-prerendering.mdx
index c1d9d1f695cf8..439f05e664e43 100644
--- a/docs/01-app/02-building-your-application/03-rendering/04-partial-prerendering.mdx
+++ b/docs/01-app/02-building-your-application/03-rendering/04-partial-prerendering.mdx
@@ -31,7 +31,7 @@ To prevent creating many HTTP requests for each dynamic component, PPR is able t
### Incremental Adoption (Version 15)
-In Next.js 15, you can incrementally adopt Partial Prerendering in [layouts](/docs/app/building-your-application/routing/layouts-and-templates) and [pages](/docs/app/building-your-application/routing/pages) by setting the [`ppr`](/docs/app/api-reference/next-config-js/ppr) option in `next.config.js` to `incremental`, and exporting the `experimental_ppr` [route config option](/docs/app/api-reference/file-conventions/route-segment-config) at the top of the file:
+In Next.js 15, you can incrementally adopt Partial Prerendering in [layouts](/docs/app/building-your-application/routing/layouts-and-templates) and [pages](/docs/app/building-your-application/routing/pages) by setting the [`ppr`](/docs/app/api-reference/config/next-config-js/ppr) option in `next.config.js` to `incremental`, and exporting the `experimental_ppr` [route config option](/docs/app/api-reference/file-conventions/route-segment-config) at the top of the file:
```ts filename="next.config.ts" switcher
import type { NextConfig } from 'next'
diff --git a/docs/01-app/02-building-your-application/04-caching/index.mdx b/docs/01-app/02-building-your-application/04-caching/index.mdx
index f1ea00988703d..795e3a9e1c81b 100644
--- a/docs/01-app/02-building-your-application/04-caching/index.mdx
+++ b/docs/01-app/02-building-your-application/04-caching/index.mdx
@@ -320,7 +320,7 @@ With the Router Cache:
- **Layouts** are cached and reused on navigation ([partial rendering](/docs/app/building-your-application/routing/linking-and-navigating#4-partial-rendering)).
- **Loading states** are cached and reused on navigation for [instant navigation](/docs/app/building-your-application/routing/loading-ui-and-streaming#instant-loading-states).
-- **Pages** are not cached by default, but are reused during browser backward and forward navigation. You can enable caching for page segments by using the experimental [`staleTimes`](/docs/app/api-reference/next-config-js/staleTimes) config option.
+- **Pages** are not cached by default, but are reused during browser backward and forward navigation. You can enable caching for page segments by using the experimental [`staleTimes`](/docs/app/api-reference/config/next-config-js/staleTimes) config option.
{/* TODO: Update diagram to match v15 behavior */}
@@ -337,7 +337,7 @@ The cache is stored in the browser's temporary memory. Two factors determine how
While a page refresh will clear **all** cached segments, the automatic invalidation period only affects the individual segment from the time it was prefetched.
-> **Good to know**: The experimental [`staleTimes`](/docs/app/api-reference/next-config-js/staleTimes) config option can be used to adjust the automatic invalidation times mentioned above.
+> **Good to know**: The experimental [`staleTimes`](/docs/app/api-reference/config/next-config-js/staleTimes) config option can be used to adjust the automatic invalidation times mentioned above.
### Invalidation
diff --git a/docs/01-app/02-building-your-application/05-styling/01-css.mdx b/docs/01-app/02-building-your-application/05-styling/01-css.mdx
index abd40f67a1979..2806a67ff2a02 100644
--- a/docs/01-app/02-building-your-application/05-styling/01-css.mdx
+++ b/docs/01-app/02-building-your-application/05-styling/01-css.mdx
@@ -354,7 +354,7 @@ To maintain a predictable order, we recommend the following:
> **Good to know:**
>
> - CSS ordering can behave differently in development mode, always ensure to check the build (`next build`) to verify the final CSS order.
-> - You can use the [`cssChunking`](/docs/app/api-reference/next-config-js/cssChunking) option in `next.config.js` to control how CSS is chunked.
+> - You can use the [`cssChunking`](/docs/app/api-reference/config/next-config-js/cssChunking) option in `next.config.js` to control how CSS is chunked.
diff --git a/docs/01-app/02-building-your-application/06-optimizing/01-images.mdx b/docs/01-app/02-building-your-application/06-optimizing/01-images.mdx
index 485fc5fd9d104..fce709518f7cd 100644
--- a/docs/01-app/02-building-your-application/06-optimizing/01-images.mdx
+++ b/docs/01-app/02-building-your-application/06-optimizing/01-images.mdx
@@ -367,6 +367,6 @@ For examples of the Image component used with the various styles, see the [Image
## Configuration
-The `next/image` component and Next.js Image Optimization API can be configured in the [`next.config.js` file](/docs/app/api-reference/next-config-js). These configurations allow you to [enable remote images](/docs/app/api-reference/components/image#remotepatterns), [define custom image breakpoints](/docs/app/api-reference/components/image#devicesizes), [change caching behavior](/docs/app/api-reference/components/image#caching-behavior) and more.
+The `next/image` component and Next.js Image Optimization API can be configured in the [`next.config.js` file](/docs/app/api-reference/config/next-config-js). These configurations allow you to [enable remote images](/docs/app/api-reference/components/image#remotepatterns), [define custom image breakpoints](/docs/app/api-reference/components/image#devicesizes), [change caching behavior](/docs/app/api-reference/components/image#caching-behavior) and more.
[**Read the full image configuration documentation for more information.**](/docs/app/api-reference/components/image#configuration-options)
diff --git a/docs/01-app/02-building-your-application/06-optimizing/05-scripts.mdx b/docs/01-app/02-building-your-application/06-optimizing/05-scripts.mdx
index c216df896df3c..ffb8b4e54398c 100644
--- a/docs/01-app/02-building-your-application/06-optimizing/05-scripts.mdx
+++ b/docs/01-app/02-building-your-application/06-optimizing/05-scripts.mdx
@@ -216,7 +216,7 @@ In order to modify Partytown's configuration, the following conditions must be m
1. The `data-partytown-config` attribute must be used in order to overwrite the default configuration used by Next.js
2. Unless you decide to save Partytown's library files in a separate directory, the `lib: "/_next/static/~partytown/"` property and value must be included in the configuration object in order to let Partytown know where Next.js stores the necessary static files.
-> **Note**: If you are using an [asset prefix](/docs/pages/api-reference/next-config-js/assetPrefix) and would like to modify Partytown's default configuration, you must include it as part of the `lib` path.
+> **Note**: If you are using an [asset prefix](/docs/pages/api-reference/config/next-config-js/assetPrefix) and would like to modify Partytown's default configuration, you must include it as part of the `lib` path.
Take a look at Partytown's [configuration options](https://partytown.builder.io/configuration) to see the full list of other properties that can be added.
diff --git a/docs/01-app/02-building-your-application/06-optimizing/06-package-bundling.mdx b/docs/01-app/02-building-your-application/06-optimizing/06-package-bundling.mdx
index ff23b4bbae5fe..86721b8996af4 100644
--- a/docs/01-app/02-building-your-application/06-optimizing/06-package-bundling.mdx
+++ b/docs/01-app/02-building-your-application/06-optimizing/06-package-bundling.mdx
@@ -57,7 +57,7 @@ The report will open three new tabs in your browser, which you can inspect. Peri
Some packages, such as icon libraries, can export hundreds of modules, which can cause performance issues in development and production.
-You can optimize how these packages are imported by adding the [`optimizePackageImports`](/docs/app/api-reference/next-config-js/optimizePackageImports) option to your `next.config.js`. This option will only load the modules you _actually_ use, while still giving you the convenience of writing import statements with many named exports.
+You can optimize how these packages are imported by adding the [`optimizePackageImports`](/docs/app/api-reference/config/next-config-js/optimizePackageImports) option to your `next.config.js`. This option will only load the modules you _actually_ use, while still giving you the convenience of writing import statements with many named exports.
```js filename="next.config.js"
/** @type {import('next').NextConfig} */
@@ -70,13 +70,13 @@ const nextConfig = {
module.exports = nextConfig
```
-Next.js also optimizes some libraries automatically, thus they do not need to be included in the optimizePackageImports list. See the [full list](https://nextjs.org/docs/app/api-reference/next-config-js/optimizePackageImports).
+Next.js also optimizes some libraries automatically, thus they do not need to be included in the optimizePackageImports list. See the [full list](https://nextjs.org/docs/app/api-reference/config/next-config-js/optimizePackageImports).
## Bundling specific packages
-To bundle specific packages, you can use the [`transpilePackages`](/docs/app/api-reference/next-config-js/transpilePackages) option in your `next.config.js`. This option is useful for bundling external packages that are not pre-bundled, for example, in a monorepo or imported from `node_modules`.
+To bundle specific packages, you can use the [`transpilePackages`](/docs/app/api-reference/config/next-config-js/transpilePackages) option in your `next.config.js`. This option is useful for bundling external packages that are not pre-bundled, for example, in a monorepo or imported from `node_modules`.
```js filename="next.config.js"
/** @type {import('next').NextConfig} */
@@ -89,7 +89,7 @@ module.exports = nextConfig
## Bundling all packages
-To automatically bundle all packages (default behavior in the App Router), you can use the [`bundlePagesRouterDependencies`](/docs/pages/api-reference/next-config-js/bundlePagesRouterDependencies) option in your `next.config.js`.
+To automatically bundle all packages (default behavior in the App Router), you can use the [`bundlePagesRouterDependencies`](/docs/pages/api-reference/config/next-config-js/bundlePagesRouterDependencies) option in your `next.config.js`.
```js filename="next.config.js"
/** @type {import('next').NextConfig} */
@@ -102,7 +102,7 @@ module.exports = nextConfig
## Opting specific packages out of bundling
-If you have the [`bundlePagesRouterDependencies`](/docs/pages/api-reference/next-config-js/bundlePagesRouterDependencies) option enabled, you can opt specific packages out of automatic bundling using the [`serverExternalPackages`](/docs/pages/api-reference/next-config-js/serverExternalPackages) option in your `next.config.js`:
+If you have the [`bundlePagesRouterDependencies`](/docs/pages/api-reference/config/next-config-js/bundlePagesRouterDependencies) option enabled, you can opt specific packages out of automatic bundling using the [`serverExternalPackages`](/docs/pages/api-reference/config/next-config-js/serverExternalPackages) option in your `next.config.js`:
```js filename="next.config.js"
/** @type {import('next').NextConfig} */
@@ -122,7 +122,7 @@ module.exports = nextConfig
## Opting specific packages out of bundling
-Since packages imported inside Server Components and Route Handlers are automatically bundled by Next.js, you can opt specific packages out of bundling using the [`serverExternalPackages`](/docs/app/api-reference/next-config-js/serverExternalPackages) option in your `next.config.js`.
+Since packages imported inside Server Components and Route Handlers are automatically bundled by Next.js, you can opt specific packages out of bundling using the [`serverExternalPackages`](/docs/app/api-reference/config/next-config-js/serverExternalPackages) option in your `next.config.js`.
```js filename="next.config.js"
/** @type {import('next').NextConfig} */
@@ -133,6 +133,6 @@ const nextConfig = {
module.exports = nextConfig
```
-Next.js includes a list of popular packages that currently are working on compatibility and automatically opt-ed out. See the [full list](/docs/app/api-reference/next-config-js/serverExternalPackages).
+Next.js includes a list of popular packages that currently are working on compatibility and automatically opt-ed out. See the [full list](/docs/app/api-reference/config/next-config-js/serverExternalPackages).
diff --git a/docs/01-app/02-building-your-application/06-optimizing/09-instrumentation.mdx b/docs/01-app/02-building-your-application/06-optimizing/09-instrumentation.mdx
index a2e92ed34defc..f4113ac6bfa0a 100644
--- a/docs/01-app/02-building-your-application/06-optimizing/09-instrumentation.mdx
+++ b/docs/01-app/02-building-your-application/06-optimizing/09-instrumentation.mdx
@@ -40,7 +40,7 @@ See the [Next.js with OpenTelemetry example](https://github.com/vercel/next.js/t
> **Good to know**:
>
> - The `instrumentation` file should be in the root of your project and not inside the `app` or `pages` directory. If you're using the `src` folder, then place the file inside `src` alongside `pages` and `app`.
-> - If you use the [`pageExtensions` config option](/docs/app/api-reference/next-config-js/pageExtensions) to add a suffix, you will also need to update the `instrumentation` filename to match.
+> - If you use the [`pageExtensions` config option](/docs/app/api-reference/config/next-config-js/pageExtensions) to add a suffix, you will also need to update the `instrumentation` filename to match.
## Examples
diff --git a/docs/01-app/02-building-your-application/06-optimizing/10-open-telemetry.mdx b/docs/01-app/02-building-your-application/06-optimizing/10-open-telemetry.mdx
index 270105d3a87a0..39839f5fc1c2a 100644
--- a/docs/01-app/02-building-your-application/06-optimizing/10-open-telemetry.mdx
+++ b/docs/01-app/02-building-your-application/06-optimizing/10-open-telemetry.mdx
@@ -66,7 +66,7 @@ See the [`@vercel/otel` documentation](https://www.npmjs.com/package/@vercel/ote
> **Good to know**:
>
> - The `instrumentation` file should be in the root of your project and not inside the `app` or `pages` directory. If you're using the `src` folder, then place the file inside `src` alongside `pages` and `app`.
-> - If you use the [`pageExtensions` config option](/docs/app/api-reference/next-config-js/pageExtensions) to add a suffix, you will also need to update the `instrumentation` filename to match.
+> - If you use the [`pageExtensions` config option](/docs/app/api-reference/config/next-config-js/pageExtensions) to add a suffix, you will also need to update the `instrumentation` filename to match.
> - We have created a basic [with-opentelemetry](https://github.com/vercel/next.js/tree/canary/examples/with-opentelemetry) example that you can use.
@@ -76,7 +76,7 @@ See the [`@vercel/otel` documentation](https://www.npmjs.com/package/@vercel/ote
> **Good to know**:
>
> - The `instrumentation` file should be in the root of your project and not inside the `app` or `pages` directory. If you're using the `src` folder, then place the file inside `src` alongside `pages` and `app`.
-> - If you use the [`pageExtensions` config option](/docs/pages/api-reference/next-config-js/pageExtensions) to add a suffix, you will also need to update the `instrumentation` filename to match.
+> - If you use the [`pageExtensions` config option](/docs/pages/api-reference/config/next-config-js/pageExtensions) to add a suffix, you will also need to update the `instrumentation` filename to match.
> - We have created a basic [with-opentelemetry](https://github.com/vercel/next.js/tree/canary/examples/with-opentelemetry) example that you can use.
diff --git a/docs/01-app/02-building-your-application/06-optimizing/13-memory-usage.mdx b/docs/01-app/02-building-your-application/06-optimizing/13-memory-usage.mdx
index b4e1bdab3f34b..46011e262c17c 100644
--- a/docs/01-app/02-building-your-application/06-optimizing/13-memory-usage.mdx
+++ b/docs/01-app/02-building-your-application/06-optimizing/13-memory-usage.mdx
@@ -69,7 +69,7 @@ If you are using an older version of Next.js or you have a custom Webpack config
The [Webpack cache](https://webpack.js.org/configuration/cache/) saves generated Webpack modules in memory and/or to disk to improve the speed of builds. This can
help with performance, but it will also increase the memory usage of your application to store the cached data.
-You can disable this behavior by adding a [custom Webpack configuration](/docs/app/api-reference/next-config-js/webpack) to your application:
+You can disable this behavior by adding a [custom Webpack configuration](/docs/app/api-reference/config/next-config-js/webpack) to your application:
```js filename="next.config.mjs"
/** @type {import('next').NextConfig} */
@@ -118,7 +118,7 @@ export default nextConfig
```
- [Ignoring TypeScript Errors](/docs/app/api-reference/config/typescript#disabling-typescript-errors-in-production)
-- [ESLint in Next.js config](/docs/pages/api-reference/next-config-js/eslint)
+- [ESLint in Next.js config](/docs/pages/api-reference/config/next-config-js/eslint)
Keep in mind that this may produce faulty deploys due to type errors or linting issues.
We strongly recommend only promoting builds to production after static analysis has completed.
diff --git a/docs/01-app/02-building-your-application/07-configuring/03-environment-variables.mdx b/docs/01-app/02-building-your-application/07-configuring/03-environment-variables.mdx
index 6c41834932b85..82426438a978a 100644
--- a/docs/01-app/02-building-your-application/07-configuring/03-environment-variables.mdx
+++ b/docs/01-app/02-building-your-application/07-configuring/03-environment-variables.mdx
@@ -232,7 +232,7 @@ This allows you to use a singular Docker image that can be promoted through mult
**Good to know:**
- You can run code on server startup using the [`register` function](/docs/app/building-your-application/optimizing/instrumentation).
-- We do not recommend using the [runtimeConfig](/docs/pages/api-reference/next-config-js/runtime-configuration) option, as this does not work with the standalone output mode. Instead, we recommend [incrementally adopting](/docs/app/building-your-application/upgrading/app-router-migration) the App Router.
+- We do not recommend using the [runtimeConfig](/docs/pages/api-reference/config/next-config-js/runtime-configuration) option, as this does not work with the standalone output mode. Instead, we recommend [incrementally adopting](/docs/app/building-your-application/upgrading/app-router-migration) the App Router.
## Default Environment Variables
diff --git a/docs/01-app/02-building-your-application/07-configuring/15-content-security-policy.mdx b/docs/01-app/02-building-your-application/07-configuring/15-content-security-policy.mdx
index 84ba41ab82f70..7dc4de821d9d6 100644
--- a/docs/01-app/02-building-your-application/07-configuring/15-content-security-policy.mdx
+++ b/docs/01-app/02-building-your-application/07-configuring/15-content-security-policy.mdx
@@ -209,7 +209,7 @@ export default async function Page() {
## Without Nonces
-For applications that do not require nonces, you can set the CSP header directly in your [`next.config.js`](/docs/app/api-reference/next-config-js) file:
+For applications that do not require nonces, you can set the CSP header directly in your [`next.config.js`](/docs/app/api-reference/config/next-config-js) file:
```js filename="next.config.js"
const cspHeader = `
diff --git a/docs/01-app/02-building-your-application/10-deploying/02-static-exports.mdx b/docs/01-app/02-building-your-application/10-deploying/02-static-exports.mdx
index 8c8ca465f848f..9a91d2220ca56 100644
--- a/docs/01-app/02-building-your-application/10-deploying/02-static-exports.mdx
+++ b/docs/01-app/02-building-your-application/10-deploying/02-static-exports.mdx
@@ -280,9 +280,9 @@ Features that require a Node.js server, or dynamic logic that cannot be computed
- [Dynamic Routes](/docs/app/building-your-application/routing/dynamic-routes) without `generateStaticParams()`
- [Route Handlers](/docs/app/building-your-application/routing/route-handlers) that rely on Request
- [Cookies](/docs/app/api-reference/functions/cookies)
-- [Rewrites](/docs/app/api-reference/next-config-js/rewrites)
-- [Redirects](/docs/app/api-reference/next-config-js/redirects)
-- [Headers](/docs/app/api-reference/next-config-js/headers)
+- [Rewrites](/docs/app/api-reference/config/next-config-js/rewrites)
+- [Redirects](/docs/app/api-reference/config/next-config-js/redirects)
+- [Headers](/docs/app/api-reference/config/next-config-js/headers)
- [Middleware](/docs/app/building-your-application/routing/middleware)
- [Incremental Static Regeneration](/docs/app/building-your-application/data-fetching/incremental-static-regeneration)
- [Image Optimization](/docs/app/building-your-application/optimizing/images) with the default `loader`
@@ -301,9 +301,9 @@ export const dynamic = 'error'
- [Internationalized Routing](/docs/pages/building-your-application/routing/internationalization)
- [API Routes](/docs/pages/building-your-application/routing/api-routes)
-- [Rewrites](/docs/pages/api-reference/next-config-js/rewrites)
-- [Redirects](/docs/pages/api-reference/next-config-js/redirects)
-- [Headers](/docs/pages/api-reference/next-config-js/headers)
+- [Rewrites](/docs/pages/api-reference/config/next-config-js/rewrites)
+- [Redirects](/docs/pages/api-reference/config/next-config-js/redirects)
+- [Headers](/docs/pages/api-reference/config/next-config-js/headers)
- [Middleware](/docs/pages/building-your-application/routing/middleware)
- [Incremental Static Regeneration](/docs/pages/building-your-application/data-fetching/incremental-static-regeneration)
- [Image Optimization](/docs/pages/building-your-application/optimizing/images) with the default `loader`
diff --git a/docs/01-app/02-building-your-application/10-deploying/03-multi-zones.mdx b/docs/01-app/02-building-your-application/10-deploying/03-multi-zones.mdx
index 6084912ab5348..2fd14edd49602 100644
--- a/docs/01-app/02-building-your-application/10-deploying/03-multi-zones.mdx
+++ b/docs/01-app/02-building-your-application/10-deploying/03-multi-zones.mdx
@@ -36,7 +36,7 @@ Navigating from a page in one zone to a page in another zone, such as from `/` t
## How to define a zone
-A zone is a normal Next.js application where you also configure an [assetPrefix](/docs/app/api-reference/next-config-js/assetPrefix) to avoid conflicts with pages and static files in other zones.
+A zone is a normal Next.js application where you also configure an [assetPrefix](/docs/app/api-reference/config/next-config-js/assetPrefix) to avoid conflicts with pages and static files in other zones.
```js filename="next.config.js"
/** @type {import('next').NextConfig} */
@@ -72,7 +72,7 @@ const nextConfig = {
With the Multi Zones set-up, you need to route the paths to the correct zone since they are served by different applications. You can use any HTTP proxy to do this, but one of the Next.js applications can also be used to route requests for the entire domain.
-To route to the correct zone using a Next.js application, you can use [`rewrites`](/docs/app/api-reference/next-config-js/rewrites). For each path served by a different zone, you would add a rewrite rule to send that path to the domain of the other zone. For example:
+To route to the correct zone using a Next.js application, you can use [`rewrites`](/docs/app/api-reference/config/next-config-js/rewrites). For each path served by a different zone, you would add a rewrite rule to send that path to the domain of the other zone. For example:
```js filename="next.config.js"
async rewrites() {
@@ -95,7 +95,7 @@ async rewrites() {
### Routing requests using middleware
-Routing requests through [`rewrites`](/docs/app/api-reference/next-config-js/rewrites) is recommended to minimize latency overhead for the requests, but middleware can also be used when there is a need for a dynamic decision when routing. For example, if you are using a feature flag to decide where a path should be routed such as during a migration, you can use middleware.
+Routing requests through [`rewrites`](/docs/app/api-reference/config/next-config-js/rewrites) is recommended to minimize latency overhead for the requests, but middleware can also be used when there is a need for a dynamic decision when routing. For example, if you are using a feature flag to decide where a path should be routed such as during a migration, you can use middleware.
```js filename="middleware.js"
export async function middleware(request) {
@@ -134,6 +134,6 @@ const nextConfig = {
}
```
-See [`serverActions.allowedOrigins`](/docs/app/api-reference/next-config-js/serverActions#allowedorigins) for more information.
+See [`serverActions.allowedOrigins`](/docs/app/api-reference/config/next-config-js/serverActions#allowedorigins) for more information.
diff --git a/docs/01-app/02-building-your-application/10-deploying/index.mdx b/docs/01-app/02-building-your-application/10-deploying/index.mdx
index d09dd8ce81a27..7452831a0b594 100644
--- a/docs/01-app/02-building-your-application/10-deploying/index.mdx
+++ b/docs/01-app/02-building-your-application/10-deploying/index.mdx
@@ -104,7 +104,7 @@ Image Optimization can be used with a [static export](/docs/app/building-your-ap
Middleware uses a [runtime](/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes) that is a subset of all available Node.js APIs to help ensure low latency, since it may run in front of every route or asset in your application. This runtime does not require running “at the edge” and works in a single-region server. Additional configuration and infrastructure are required to run Middleware in multiple regions.
-If you are looking to add logic (or use an external package) that requires all Node.js APIs, you might be able to move this logic to a [layout](/docs/app/building-your-application/routing/layouts-and-templates#layouts) as a [Server Component](/docs/app/building-your-application/rendering/server-components). For example, checking [headers](/docs/app/api-reference/functions/headers) and [redirecting](/docs/app/api-reference/functions/redirect). You can also use headers, cookies, or query parameters to [redirect](/docs/app/api-reference/next-config-js/redirects#header-cookie-and-query-matching) or [rewrite](/docs/app/api-reference/next-config-js/rewrites#header-cookie-and-query-matching) through `next.config.js`. If that does not work, you can also use a [custom server](/docs/pages/building-your-application/configuring/custom-server).
+If you are looking to add logic (or use an external package) that requires all Node.js APIs, you might be able to move this logic to a [layout](/docs/app/building-your-application/routing/layouts-and-templates#layouts) as a [Server Component](/docs/app/building-your-application/rendering/server-components). For example, checking [headers](/docs/app/api-reference/functions/headers) and [redirecting](/docs/app/api-reference/functions/redirect). You can also use headers, cookies, or query parameters to [redirect](/docs/app/api-reference/config/next-config-js/redirects#header-cookie-and-query-matching) or [rewrite](/docs/app/api-reference/config/next-config-js/rewrites#header-cookie-and-query-matching) through `next.config.js`. If that does not work, you can also use a [custom server](/docs/pages/building-your-application/configuring/custom-server).
### Environment Variables
@@ -155,7 +155,7 @@ This allows you to use a singular Docker image that can be promoted through mult
> **Good to know:**
>
> - You can run code on server startup using the [`register` function](/docs/app/building-your-application/optimizing/instrumentation).
-> - We do not recommend using the [runtimeConfig](/docs/pages/api-reference/next-config-js/runtime-configuration) option, as this does not work with the standalone output mode. Instead, we recommend [incrementally adopting](/docs/app/building-your-application/upgrading/app-router-migration) the App Router.
+> - We do not recommend using the [runtimeConfig](/docs/pages/api-reference/config/next-config-js/runtime-configuration) option, as this does not work with the standalone output mode. Instead, we recommend [incrementally adopting](/docs/app/building-your-application/upgrading/app-router-migration) the App Router.
### Caching and ISR
@@ -173,9 +173,9 @@ You can configure the Next.js cache location if you want to persist cached pages
#### Static Assets
-If you want to host static assets on a different domain or CDN, you can use the `assetPrefix` [configuration](/docs/app/api-reference/next-config-js/assetPrefix) in `next.config.js`. Next.js will use this asset prefix when retrieving JavaScript or CSS files. Separating your assets to a different domain does come with the downside of extra time spent on DNS and TLS resolution.
+If you want to host static assets on a different domain or CDN, you can use the `assetPrefix` [configuration](/docs/app/api-reference/config/next-config-js/assetPrefix) in `next.config.js`. Next.js will use this asset prefix when retrieving JavaScript or CSS files. Separating your assets to a different domain does come with the downside of extra time spent on DNS and TLS resolution.
-[Learn more about `assetPrefix`](/docs/app/api-reference/next-config-js/assetPrefix).
+[Learn more about `assetPrefix`](/docs/app/api-reference/config/next-config-js/assetPrefix).
#### Configuring Caching
diff --git a/docs/01-app/02-building-your-application/11-upgrading/02-version-15.mdx b/docs/01-app/02-building-your-application/11-upgrading/02-version-15.mdx
index 48e37a6bf891b..6b84fd4be456b 100644
--- a/docs/01-app/02-building-your-application/11-upgrading/02-version-15.mdx
+++ b/docs/01-app/02-building-your-application/11-upgrading/02-version-15.mdx
@@ -498,7 +498,7 @@ export async function GET() {}
When navigating between pages via `` or `useRouter`, [page](/docs/app/api-reference/file-conventions/page) segments are no longer reused from the client-side router cache. However, they are still reused during browser backward and forward navigation and for shared layouts.
-To opt page segments into caching, you can use the [`staleTimes`](/docs/app/api-reference/next-config-js/staleTimes) config option:
+To opt page segments into caching, you can use the [`staleTimes`](/docs/app/api-reference/config/next-config-js/staleTimes) config option:
```js filename="next.config.js"
/** @type {import('next').NextConfig} */
diff --git a/docs/01-app/02-building-your-application/11-upgrading/05-from-create-react-app.mdx b/docs/01-app/02-building-your-application/11-upgrading/05-from-create-react-app.mdx
index f16ea4e6b89cb..5a49b1c2870ff 100644
--- a/docs/01-app/02-building-your-application/11-upgrading/05-from-create-react-app.mdx
+++ b/docs/01-app/02-building-your-application/11-upgrading/05-from-create-react-app.mdx
@@ -58,7 +58,7 @@ npm install next@latest
### Step 2: Create the Next.js Configuration File
-Create a `next.config.mjs` at the root of your project. This file will hold your [Next.js configuration options](/docs/app/api-reference/next-config-js).
+Create a `next.config.mjs` at the root of your project. This file will hold your [Next.js configuration options](/docs/app/api-reference/config/next-config-js).
```js filename="next.config.mjs"
/** @type {import('next').NextConfig} */
@@ -478,9 +478,9 @@ You can now clean up your codebase from Create React App related artifacts:
Create React App and Next.js both default to using webpack for bundling.
-When migrating your CRA application to Next.js, you might have a custom webpack configuration you're looking to migrate. Next.js supports providing a [custom webpack configuration](/docs/app/api-reference/next-config-js/webpack).
+When migrating your CRA application to Next.js, you might have a custom webpack configuration you're looking to migrate. Next.js supports providing a [custom webpack configuration](/docs/app/api-reference/config/next-config-js/webpack).
-Further, Next.js has support for [Turbopack](/docs/app/api-reference/next-config-js/turbo) through `next dev --turbopack` to improve your local dev performance. Turbopack supports some [webpack loaders](/docs/app/api-reference/next-config-js/turbo) as well for compatibility and incremental adoption.
+Further, Next.js has support for [Turbopack](/docs/app/api-reference/config/next-config-js/turbo) through `next dev --turbopack` to improve your local dev performance. Turbopack supports some [webpack loaders](/docs/app/api-reference/config/next-config-js/turbo) as well for compatibility and incremental adoption.
## Next Steps
diff --git a/docs/01-app/02-building-your-application/11-upgrading/06-from-vite.mdx b/docs/01-app/02-building-your-application/11-upgrading/06-from-vite.mdx
index ccd109a6ccc7d..c14b192acc836 100644
--- a/docs/01-app/02-building-your-application/11-upgrading/06-from-vite.mdx
+++ b/docs/01-app/02-building-your-application/11-upgrading/06-from-vite.mdx
@@ -62,7 +62,7 @@ npm install next@latest
### Step 2: Create the Next.js Configuration File
Create a `next.config.mjs` at the root of your project. This file will hold your
-[Next.js configuration options](/docs/app/api-reference/next-config-js).
+[Next.js configuration options](/docs/app/api-reference/config/next-config-js).
```js filename="next.config.mjs"
/** @type {import('next').NextConfig} */
@@ -537,7 +537,7 @@ configure one, if you need it:
NEXT_PUBLIC_BASE_PATH="/some-base-path"
```
-2. **Set [`basePath`](/docs/app/api-reference/next-config-js/basePath) to `process.env.NEXT_PUBLIC_BASE_PATH` in your `next.config.mjs` file:**
+2. **Set [`basePath`](/docs/app/api-reference/config/next-config-js/basePath) to `process.env.NEXT_PUBLIC_BASE_PATH` in your `next.config.mjs` file:**
```js filename="next.config.mjs"
/** @type {import('next').NextConfig} */
diff --git a/docs/01-app/03-api-reference/01-directives/use-cache.mdx b/docs/01-app/03-api-reference/01-directives/use-cache.mdx
index 9f9df5d335145..bb3f02779380a 100644
--- a/docs/01-app/03-api-reference/01-directives/use-cache.mdx
+++ b/docs/01-app/03-api-reference/01-directives/use-cache.mdx
@@ -6,8 +6,8 @@ related:
title: Related
description: View related API references.
links:
- - app/api-reference/next-config-js/dynamicIO
- - app/api-reference/next-config-js/cacheLife
+ - app/api-reference/config/next-config-js/dynamicIO
+ - app/api-reference/config/next-config-js/cacheLife
- app/api-reference/functions/cacheTag
- app/api-reference/functions/cacheLife
- app/api-reference/functions/revalidateTag
@@ -17,7 +17,7 @@ The `use cache` directive designates a component and/or a function to be cached.
## Usage
-Enable support for the `use cache` directive with the [`dynamicIO`](/docs/app/api-reference/next-config-js/dynamicIO) flag in your `next.config.ts` file:
+Enable support for the `use cache` directive with the [`dynamicIO`](/docs/app/api-reference/config/next-config-js/dynamicIO) flag in your `next.config.ts` file:
```ts filename="next.config.ts"
import type { NextConfig } from 'next'
@@ -64,7 +64,7 @@ export async function getData() {
- The return value of the cacheable function must also be serializable. This ensures that the cached data can be stored and retrieved correctly.
- Functions that use the `use cache` directive must not have any side-effects, such as modifying state, directly manipulating the DOM, or setting timers to execute code at intervals.
- If used alongside [Partial Prerendering](/docs/app/building-your-application/rendering/partial-prerendering), segments that have `use cache` will be prerendered as part of the static HTML shell.
-- The `use cache` directive will be available separately from the [`dynamicIO`](/docs/app/api-reference/next-config-js/dynamicIO) flag in the future.
+- The `use cache` directive will be available separately from the [`dynamicIO`](/docs/app/api-reference/config/next-config-js/dynamicIO) flag in the future.
- Unlike [`unstable_cache`](/docs/app/api-reference/functions/unstable_cache) which only supports JSON data, `use cache` can cache any serializable data React can render, including the render output of components.
## Examples
diff --git a/docs/01-app/03-api-reference/02-components/form.mdx b/docs/01-app/03-api-reference/02-components/form.mdx
index d77c718f2d046..7acd835ce6700 100644
--- a/docs/01-app/03-api-reference/02-components/form.mdx
+++ b/docs/01-app/03-api-reference/02-components/form.mdx
@@ -152,7 +152,7 @@ When `action` is a function, the `