0

I have a domain name (Eg: www.myurl.com) and my website is running in an Elastic Beanstalk instance on AWS EC2.

I have created a hosted zone and made all the entries for pointing my domain to my EC2 instance.

Everything works fine, but the only problem is , when I hit my domain url (www.myurl.com) , the website loads from EC2 but the url also changes to the EC2 url, something like (http://someec2.url.aws.com)

How can I keep my url (www.myurl.com) in the browser, while the website still loads from ec2 and restrict to show the ec2 url.

Quick response is appreciated.

Thanks in advance.

1
  • I'm reasonably sure that if you search this site, you'll find your answer. If you inspect your HTTP response headers and your web server access logs, you'll also find that your server is actually triggering this behavior. Jun 24, 2017 at 0:40

2 Answers 2

0

I think you are doing a redirection somewhere

Make sure your Route 53 is authoritative for your zone. Which means you need to go to your registrar and make sure you put the DNS servers as the ones from Route 53.

Once you have done that, make sure you create a CNAME (or A record) on Route 53 and point it to your EC2 name (or IP address).

2
  • Hi, Thanks for responding. I did checked all the configs, but I am still stuck. Here is the configs that I have :- <br> NS records (Nameservers_ - All pointing to AWS servers <br> SOA record - Pointing to AWS default <br> A record - www.mysite.com ( pointing to the ip address on my EC2) <br> A record - an alias record for (mysite.com) pointing to existing A record ((www.mysite.com) <br> CName - I tried creating a cname record instead of A-record, but it also didn't work <br> But still when I hit my website (www.mysite.com) , the url in browser changes to (myec2 url) . Jun 25, 2017 at 23:24
  • No need to do anything with SOA. Can you share what this command's output? nslookup www.mysite.com nslookup mysite.com Jun 27, 2017 at 16:22
0

Thanks for responding. I did checked all the configs, but I am still stuck. Here is the configs that I have :-

NS records (Nameservers_ - All pointing to AWS servers

SOA record - Pointing to AWS default

A record - www.mysite.com ( pointing to the ip address on my EC2)

A record - an alias record for (mysite.com) pointing to existing A record ((www.mysite.com)

CName - I tried creating a cname record instead of A-record, but it also didn't work
But still when I hit my website (www.mysite.com) , the url in browser changes to (myec2 url) .Am I still missing something.

1
  • No need to do anything with SOA. Can you share what this command's output? nslookup www.mysite.com nslookup mysite.com Jun 26, 2017 at 20:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .