Vercel (and Next.js) both offer the ability to add Redirects and Rewrites to your application. This approach is commonly used for subpaths. For example, adding a redirect from acme.com/old to acme.com/new.
If you want to rewrite app.acme.com to acme.com/app, you'll need to configure a rewrite making use of the has field.
- Create a
next.config.jsfile is using Next.js or avercel.jsonfile like below. - Push your changes and redeploy your application.
When a request is made to app.acme.com, then it will be rewritten to acme.com/app.