Hey guys, greetings.
I’m building a Next.js application, and I’d like also to have a docs page. I have defined all of my pages (/about, /blog, /docs ) - but I have a little issue with my /docs.
I want to use a different repo ( I don’t want to make my main repo too large because of the docs content, so I want to create a different one for that).
What I want is, when a user navigate to /docs
, it should rewrite the request to docs.maindomain.com
.
docs.maindomain.com is the repo for the docs, so I want to server the content to the users directly from maindomain.com/docs.
I’ve created a vercel.json
file, and added this…
{
"rewrites": [
{
"source": "/docs/:path*",
"destination": "https://docs.tryharmono.com/:path*"
}
]
}
so far, it’s working but the styles are not being fetched. On the console, I can see some 404 on my static files.
GET https://www.maindomain.com/_next/static/chunks/fd9d1056-d88b6ffed1219985.js net::ERR_ABORTED 404 (Not Found)Understand this error
test:1
The styles is failing because they’re in the docs.maindomain.com
, and not maindomain.com
.
I don’t know how to get the styles from the docs.maindomain.com
- so I’m asking for help.
it would be nice to do a rewriting for the assets/static files, but I can’t.
If there’s any way, please let me know