@@ -4,6 +4,8 @@ description: Learn more about setting a base path in Next.js
# Base Path
> This feature was introduced in [Next.js 9.5](https://nextjs.org/blog/next-9-5) and up. If you’re using older versions of Next.js, please upgrade before trying it out.
To deploy a Next.js application under a sub-path of a domain you can use the `basePath` option.
`basePath` allows you to set a path prefix for the application. For example `/docs` instead of `/` (the default).
@@ -4,6 +4,8 @@ description: Add custom HTTP headers to your Next.js app.
# Headers
> This feature was introduced in [Next.js 9.5](https://nextjs.org/blog/next-9-5) and up. If you’re using older versions of Next.js, please upgrade before trying it out.
Headers allow you to set custom HTTP headers for an incoming request path.
To set custom HTTP headers you can use the `headers` key in `next.config.js`:
@@ -4,6 +4,8 @@ description: Add redirects to your Next.js app.
# Redirects
> This feature was introduced in [Next.js 9.5](https://nextjs.org/blog/next-9-5) and up. If you’re using older versions of Next.js, please upgrade before trying it out.
Redirects allow you to redirect an incoming request path to a different destination path.
Redirects are only available on the Node.js environment and do not affect client-side routing.
@@ -4,6 +4,8 @@ description: Add rewrites to your Next.js app.
# Rewrites
> This feature was introduced in [Next.js 9.5](https://nextjs.org/blog/next-9-5) and up. If you’re using older versions of Next.js, please upgrade before trying it out.
@@ -4,6 +4,8 @@ description: Configure Next.js pages to resolve with or without a trailing slash
# Trailing Slash
> This feature was introduced in [Next.js 9.5](https://nextjs.org/blog/next-9-5) and up. If you’re using older versions of Next.js, please upgrade before trying it out.
By default Next.js will redirect urls with trailing slashes to their counterpart without a trailing slash. For example `/about/` will redirect to `/about`. You can configure this behavior to act the opposite way, where urls without trailing slashes are redirected to their counterparts with trailing slashes.
Open `next.config.js` and add the `trailingSlash` config: