wordpress domain setup with ec2 apache

All the links in a wordpress database are relational, and based on the URL structure that was used when the database was created. What you need to do is follow the steps to change the URL of the WordPress instance and that should resolve your problem.

This is common when changing from a dev platform to a live site. FWIW I think that manually changing it in the database it the easiest way to accomplish what you’re looking to do.