Search code examples
amazon-web-servicesurlroutesdnscloud

How does url http://app.mywebsite.com works?


I am currently developping a SASS web application, and I want to deploy my react app under an url like "https://app.my-website.example". So I tried to buy the domain name "app.my-website.example", but apparently, domain name cannot contain "." character.

How can I deploy it under an url like "https://app.my-website.example" ?

I have seen quantity of modern websites with url containing "app." at the beginning. For example, website about crypto usually have a traditional static website describing the project, deployed on an url like "https://website.example". And then, their actual application, which does stuff, is deployed on an url like "https://app.website.example".

This is also true for most web application out there.

I use AWS Amazon cloud if it helps you answer me.

Btw, I have already bought the domain name like "my-website.example" and have deployed my static website on it.


Solution

  • Here is the solution.

    So the answer to my question is that I need to create a sub domain inside my main domain. I don't need to buy anything else to create the subdomain, since I already own the domain. It is the main advantage compared to buying "app-mywebsite.com". Plus, it will be easier for google to reference my app.

    On amazon, you need to go to the "route 53" service to create the subdomain and then redirect it to you application. The doc to do that is here : https://aws.amazon.com/premiumsupport/knowledge-center/create-subdomain-route-53