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.
Your rewrite configuration looks correct. The issue you’re experiencing is likely not due to the rewrite rule itself. The behavior you’re seeing (URL changing to app.mysite.com) suggests a redirect is happening, not a rewrite. Some possible causes:
WordPress settings or plugins causing redirects
Conflicting Vercel project settings
Client-side routing in your Next.js app interfering with blog URLs
Next.js middleware affecting blog post routing
Could you check the following?
Verify WordPress isn’t redirecting
Check Vercel project for conflicting rules
Examine network requests in browser dev tools
Ensure WordPress can handle requests from your Vercel domain
If these don’t resolve the issue, more details about your setup would be helpful for further troubleshooting. Let us know how you get on!