Hey guys,
I have a few subdomains set up and want to stream my traffic into different project directory based on the subdomain being visited.
A minimal version of my vercel.json looks like this -
{ "rewrites": [ { "source": "/test", "destination": "/test/$1" }, { "source": "/(.*)", "has": [{ "type": "host", "value": "api.example.com" }], "destination": "/api/$1" } ], "trailingSlash": false }
So the trailingSlash rule and the /test rule are both working as expected.
The rules like the api for the subdomain matching don't seem to work.
Expected behaviour - api.example..com/test shall fetch /api/test and show a 404 error.
Actual behaviour - api.example..com/test happily shows /test
I wonder if the has condition on host actually works or not. I thought I did everything right here. Please help if you have any ideas. Thx.