I have a complicated scenario where I need to redirect domain requests to another domain for some requests but stay in the original domain for others.
For example, if I had www.abc.com:
I want to route www.abc.com to www.abc.app. Or if the user types in www.abc.com/hello then it will route to www.abc.app/hello. This is currently done via load balancer and creating an "A" record in Route53 connected to the load balancer
BUT I want to reserve a specific subdomain. Let's say if the user types in www.abc.com/game, then I want it to display a NodeJS application that's hosted in a separate EC2 server. The domain will not change and it will remain as www.abc.com/game.
Is this at all possible to do if the "A" record is already being taken by the load balancer?
No. This is not possible to do with DNS.
DNS servers simply convert the domain name (
www.abc.com) to an IP address. The 'path' portion (/game) is not sent to the DNS servers, so they cannot use that to change the DNS resolution process.You will either need to:
game.abc.com), or