@@ -8,25 +8,24 @@ const nextConfig = {
88 { protocol : "https" , hostname : "github.com" } ,
99 ] ,
1010 } ,
11- // Marketing serves the apex; the docs app lives at /docs/* and is a
12- // separate Vercel deployment. We proxy here so /docs URLs stay on the
13- // marketing origin (SEO, cookies, one set of analytics).
11+ // Marketing serves the apex; the docs app lives on docs.nativelink.com.
12+ // Redirect /docs links there so old URLs and local nav links keep working.
1413 //
1514 // Production: target is process.env.DOCS_URL (set on Vercel).
1615 // Development: target is process.env.DOCS_DEV_URL or localhost:3001.
17- async rewrites ( ) {
16+ async redirects ( ) {
1817 const target =
1918 process . env . NODE_ENV === "production"
2019 ? process . env . DOCS_URL
2120 : ( process . env . DOCS_DEV_URL ?? "http://localhost:3001" ) ;
2221
23- // If we're in production and DOCS_URL isn't set, skip the rewrite
24- // entirely — better to 404 cleanly than to proxy to nothing.
22+ // If we're in production and DOCS_URL isn't set, skip the redirect
23+ // entirely — better to 404 cleanly than to redirect to nothing.
2524 if ( ! target ) return [ ] ;
2625
2726 return [
28- { source : "/docs" , destination : ` ${ target } /docs` } ,
29- { source : "/docs/:path*" , destination : `${ target } /docs/ :path*` } ,
27+ { source : "/docs" , destination : target , permanent : false } ,
28+ { source : "/docs/:path*" , destination : `${ target } /:path*` , permanent : false } ,
3029 ] ;
3130 } ,
3231} ;
0 commit comments