#How to redirect one specific domain to a specific path?
8 messages · Page 1 of 1 (latest)
Yes if I got you well
Use redirect for server components, otherwise useRouter for client components
https://beta.nextjs.org/docs/api-reference/redirect
https://beta.nextjs.org/docs/api-reference/use-router
It's not for components, I added another domain to Vercel and I need to redirect all traffic, but not to the main domain, but to the sub-path
Oh I got you
You can use middleware for this
And match the root route
yeah, I've tried that many times via next.config.js but I cannot find the correct syntax.
Found this, works kind of, but not exactly: https://vercel.com/guides/can-i-redirect-from-a-subdomain-to-a-subpath
In the middleware I cannot find example with a different domain or host