-
Subdomains and URL rewrites are great features on their own, but (dis)allowing rewrites based on aliases would open up new possibilities. Similarly to this example, someone may want to serve the contents of each subdomain from a dedicated page, e.g. An example config for the routing described above may look like: {
"alias": ["my-domain.com", "*.my-domain.com"],
"rewrites": [
{
"forAlias": ["*.my-domain.com"],
"source": "/:match*",
"destination": "/custom-site/:match*"
}
]
} No multiple deployments would be required. Also, subdomains wouldn’t inherit the contents of root domains (which would become an issue while serving assets). |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
"alias" is deprecated and should not be used. We are indeed exploring a way to make this type of rewrite possible. |
Beta Was this translation helpful? Give feedback.
-
@paulogdm Thanks for your quick answer! I'm really excited that you're already considering this functionality. |
Beta Was this translation helpful? Give feedback.
-
If anyone is trying to figure this out. Next js has added a new feature in rewrites check this out |
Beta Was this translation helpful? Give feedback.
"alias" is deprecated and should not be used. We are indeed exploring a way to make this type of rewrite possible.