I am having trouble with url rewriting.
I have a website https://mysite.com with Wordpress blog hosted at https://mysite.com/blog
My blog urls are like https://mysite.com/blog/my-story
Now I am building website in Vercel and I want to keep the blog urls same for SEO reasons so I am using URL re-writing in nextjs config file.
I am fetching blog from urls like https://app.mysite.com/blog/my-story but re-writing url as https://mysite.com/blog/my-story
When I run the vercel app, it shows the home page of the blog correctly and the url is shown as https://mysite.com/blog
But when I try to load individual blog pages, the url re-writing does not work and the URL shown as https://app.mysite.com/blog/my-story
So it looks like that for nested links in wordpress, url rewriting is not working. Instead of rewriting it is actually redirecting to the url.
My next.config.js has code:
async rewrites() {
return [
{
source: '/blog/:path*',
destination: 'https://app.mysite.com/blog/:path*',
},
];
},
Am I doing something wrong?
Any help?