1

I am running an AWS EC2 Linux instance with Elastic IP a.b.c.d. and I am hosting two different websites on it:

I have purchased the following domains: serviceA.com and serviceB.com and I would like to assign them to the proper hosting path. I found how to do it with URL redirect. Is there a way to do it through DNS configuration?

Arturo
  • 423
  • 3
  • 6
  • 20

1 Answers1

3

Yes.

Make both domains point to your IP (A records).

On the AWS EC2 Linux web server configuration, set serviceA.com and serviceB.com as Virtual Hosts for serviceA and serviceB folders respectively. The server will show one website or the other based on which Host: header it receives.

Ángel
  • 852
  • 4
  • 6