FabienChn
FabienChn

Reputation: 968

How to point my external domain name to a subdirectory in my AWS EC2 instance

I'm currently migrating my web app from a shared hosting on 1&1 to an AWS EC2.

I want to keep the domain name on 1&1 for now and point it to my web page which is in my new AWS EC2.

But I'm struggling to point this domain onto a sub-directory of my EC2 instance. I mean, for now, when I type my domain name, I run into the root of my EC2 instance, but I'd like it to immediately point to a certain sub-directory containing this certain web page. I'd like to be able to have several webpages in the same EC2 instance, so I would need to have different domain names for the different sub-directories but all with the same IP

If this it is not a good way to proceed, and if it is better to have one special instance for each domain, tell me. I'm new to AWS and I'm still used to the "shared hosting habits"

Upvotes: 0

Views: 1156

Answers (1)

Mark B
Mark B

Reputation: 200672

This is not a DNS feature. You can't point a DNS name to a specific path on a server.

You need to configure whatever web server software you are running on the EC2 server to serve the contents of that subdirectory when it gets a request for that particular domain name.

Upvotes: 3

Related Questions