I have a Rails app for root domain www.xyz.com
which is hosted on Heroku. It works perfectly: all the URLs and products are shown with the proper custom domain.
I have created blog using WordPress which is a separate Heroku app and hosted on the subdomain blog.xyz.com
. The landing page works fine. However when I click on any post the URL changes to *.herokuapp.com
.
I have added a CNAME record in GoDaddy for the blog subdomain and added custom domain with following command:
heroku domains:add --app heroku-blog-wordpress-app-name blog.xyz.com
How do I get WordPress to use the correct domain?