Rewrites with subdomains
Unanswered
Cape lion posted this in #help-forum
Cape lionOP
I'm trying to rewrite to a subpath using subdomains, but the approach I'm trying doesn't work. Here's the setup I have right now:
There isn't an error message but this also doesn't work. Am I approaching this right?
async rewrites() {
return [
// some other stuff
{
source: "/",
has: [
{
type: "host",
value: "(?<username>.*).example.com",
},
],
destination: "/personal/:username/",
},
];
},There isn't an error message but this also doesn't work. Am I approaching this right?
5 Replies
It is for next.config.js?
if so, please exchange
value: "(?<username>[^.]+)\\.example\\.com",Cape lionOP
Correct, it is in next.config.js. Right, I need to escape the dots. Let me try that.
@Sun bear if so, please exchange `value: "(?<username>[^.]+)\\.example\\.com",`
Cape lionOP
Doesn't seem to work, doesn't appear to be running