---
title: trailingSlash
description: Configure Next.js pages to resolve with or without a trailing slash.
url: "https://nextjs.org/docs/14/app/api-reference/next-config-js/trailingSlash"
docs_index: /docs/14/llms.txt
version: 14.2.35
lastUpdated: 2024-01-04
prerequisites:
  - "API Reference: /docs/14/app/api-reference"
  - "next.config.js Options: /docs/14/app/api-reference/next-config-js"
---


> For an index of all Next.js documentation, see [/docs/14/llms.txt](/docs/14/llms.txt).
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:

```js filename="next.config.js"
module.exports = {
  trailingSlash: true,
}
```

With this option set, urls like `/about` will redirect to `/about/`.

When used with [`output: "export"`](/docs/app/building-your-application/deploying/static-exports) configuration, the `/about` page will output `/about/index.html` (instead of the default `/about.html`).

## Version History

| Version  | Changes                |
| -------- | ---------------------- |
| `v9.5.0` | `trailingSlash` added. |
---

For an index of all available documentation, see [/docs/14/llms.txt](/docs/14/llms.txt)