Configuration

trailingSlash

Choose a canonical URL slash convention. With true, ordinary page paths gain a trailing slash; static export uses directory index files for such pages. Some paths, including file-like paths, are exceptions. Align links, canonical metadata and proxy behavior to avoid redirect loops. Example context: Next.js 16.x documentation lane; illustrative snippet or file tree, not executed. Exact candidate patch 16.4.6 remains unverified. Expected behavior / verification: Check /catalog and /catalog/ with redirect following disabled. For static export, inspect out/catalog/index.html. Verify file-like asset URLs separately.

Formal Syntax & Structure

nextjs syntaxnextjs
trailingSlash: boolean

Working Example

Example Snippetnextjs
export default { trailingSlash: true };
Next.js Reference