1
votes

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?

1

1 Answers

0
votes

This has nothing to do with DNS. WordPress just doesn't know what domain it should use when it generates URLs.

  1. Log into WordPress
  2. Navigate to SettingsGeneral
  3. Update the WordPress Address (URL) and Site Address (URL) values to use your blog.xyz.com domain
  4. Save your settings

WordPress should now build URLs using the correct domain.