Skip to content

Commit 5526528

Browse files
GeneAIGeneAI
authored andcommitted
fix: Use skipTrailingSlashRedirect to stop Next.js from stripping trailing slashes
1 parent 4766281 commit 5526528

File tree

2 files changed

+1
-22
lines changed

2 files changed

+1
-22
lines changed

website/next.config.ts

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,13 @@ import path from "path";
44
const nextConfig: NextConfig = {
55
output: 'standalone',
66
outputFileTracingRoot: path.join(__dirname, './'),
7-
trailingSlash: true, // Ensure trailing slashes for correct relative path resolution
7+
skipTrailingSlashRedirect: true, // Don't auto-redirect trailing slashes - let middleware handle it
88
eslint: {
99
// Only run ESLint on these directories during production builds
1010
dirs: ['app'],
1111
// Ignore ESLint errors during production builds
1212
ignoreDuringBuilds: true,
1313
},
14-
async redirects() {
15-
return [
16-
// Redirect framework-docs paths without trailing slash to include trailing slash
17-
{
18-
source: '/framework-docs/:path((?!.*\\.).+)',
19-
destination: '/framework-docs/:path/',
20-
permanent: true,
21-
},
22-
];
23-
},
24-
async rewrites() {
25-
return [
26-
// Serve index.html for framework-docs directory requests
27-
{
28-
source: '/framework-docs/:path*/',
29-
destination: '/framework-docs/:path*/index.html',
30-
},
31-
];
32-
},
3314
};
3415

3516
export default nextConfig;

website/vercel.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
2-
"trailingSlash": true,
3-
"cleanUrls": false,
42
"headers": [
53
{
64
"source": "/framework-docs/(.*)",

0 commit comments

Comments
 (0)