Issue
Here's what I've done so far:
I created a free EC2 instance (used an AMI by bitnami for wordpress)
I set up a wordpress theme on it.
I bought a domain using namecheap.
I pointed that domain to the Public IP and Public DNS of my EC2 instance, by creating an A record
and CNAME record
.
So now when I enter domain.com
in my browser, it opens and resolves correctly.
But, when I put http://ec2-**-**-***.ap-south-1.compute.amazonaws.com
in my url bar, it opens up to the same landing page, but does not redirect to domain.com
.
So this means that there are two URLs which can access my website, I only want one.
I want http://ec2-**-**-***.ap-south-1.compute.amazonaws.com
to open up -> domain.com
.
Solution
You would have to configure your web server to issue a redirect response if the domain doesn't match the one you want.
Answered By - Mark B Answer Checked By - Pedro (WPSolving Volunteer)