Debugging rewrites
Unanswered
Gharial posted this in #help-forum

GharialOP
how can i debug rewrites? I want to make this rewrite but it doesn't seem to work:
even if i hardcode the tenant in it still doesn't work. Is there anything i'm missing about root rewrites? When i tried with a source that wasn't root it was working just fine.
async rewrites() {
return [
{
source: "/",
destination: "/tenant-domains/:tenant",
has: [
{
type: "host",
value: "(?<tenant>.*)",
},
],
},
];
},
even if i hardcode the tenant in it still doesn't work. Is there anything i'm missing about root rewrites? When i tried with a source that wasn't root it was working just fine.
5 Replies

GharialOP
unfortunately not. I still receive: GET /

yeah seems like you need to use middleware for multi tenancy here
next.config.js is very limited and i'm yet to see a functional multi tenant setup in nextjs with only next.config.js

GharialOP
Alright, i'll try that. Thank you.