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?



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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.