Wordpress on AWS EC2 - broken after assigning elastic IP

So, I got Wordpress installed and working just fine. I can access the site and the wp-admin via the public DNS that I get from the instance.

However, once I create an elastic IP and associate it with the instance, I can no longer access wp-admin and the home page style sheets and JavaScript files are not loaded.

I am attempting to access the site and the wp-admin using the new public IP from the elastic IP. Same thing is true if I try to use the public DNS from either the elastic IP or the EC2 instance.

When I view the page source I see that the reason things aren't loaded is because the URL for all of the assets (.css, .js. etc,) is pointing to the bold public DNS

When I disassociate the elastic IP things do not go back to working again.

I'm missing something but don't know what.

Any help would be appreciated

Answers 1

  • Your wordpress admin is already associated with your publicDNS. This is because, when you have logged-in the wp-admin console, you have created a new admin user. This information with respect to your publicDNS was saved in the mysql db. So you won't be able to access wp-admin from the elastic IP.

    What you can do ?

    You can log-in to your wordpress mysql and update all the references of the publicDNS to Elastic IP. Once it is done, you will be able to access the wp-admin from the static IP.

Related Articles