Rewrite not working on deployed app
Unanswered
Spectacled bear posted this in #help-forum
Spectacled bearOP
I have this rewrite config:
Locally everything works, app loads. I tried both
Here is original page:
https://wax-wanderer-7334.typedream.app/
Here is page with desired rewrite:
https://www.bubbleteabrno.cz/
According to DevTools other stuff returns 404, but... why if it works locally?
/** @type {import('next').NextConfig} */
const nextConfig = {
async rewrites() {
return [
{
source: "/",
destination: "https://wax-wanderer-7334.typedream.app/",
},
{
source: "/:path*",
destination: "https://wax-wanderer-7334.typedream.app/:path*",
},
];
},
};
module.exports = nextConfig;Locally everything works, app loads. I tried both
pnpm build & pnpm start as well as pnpm dev. But when I deploy to Vercel, it doesn't work.Here is original page:
https://wax-wanderer-7334.typedream.app/
Here is page with desired rewrite:
https://www.bubbleteabrno.cz/
According to DevTools other stuff returns 404, but... why if it works locally?
2 Replies
Spectacled bearOP
As I wasn't able to fix this I went with the iframe solution, but it would be better if this would work. Any ideas?
@Spectacled bear I have this rewrite config:
javascript
/** @type {import('next').NextConfig} */
const nextConfig = {
async rewrites() {
return [
{
source: "/",
destination: "https://wax-wanderer-7334.typedream.app/",
},
{
source: "/:path*",
destination: "https://wax-wanderer-7334.typedream.app/:path*",
},
];
},
};
module.exports = nextConfig;
Locally everything works, app loads. I tried both `pnpm build & pnpm start` as well as `pnpm dev`. But when I deploy to Vercel, it doesn't work.
Here is original page:
https://wax-wanderer-7334.typedream.app/
Here is page with desired rewrite:
https://www.bubbleteabrno.cz/
According to DevTools other stuff returns 404, but... why if it works locally?
interesting... it should work
you can try using middleware instead if this somehow doesn't work
you can try using middleware instead if this somehow doesn't work