Hey guys,
I’m building a web app (to be deployed on Netlify) that offers users the possibility of connecting their own custom domain that will redirect to their profile page.
So: customdomain.com => myapp.com/profile/userId
I’ve researched a lot about how to accomplish this but ended up with very fragmented pieces of information - and would like to ask for your help to guide me through what needs to be done.
WHAT I KNOW
-
I can ask the user to create a CNAME record that points his www.customdomain.com to www.myapp.com. However, to accomplish this with his naked domain, an A record pointing to my (static, dedicated) IP address would be necessary.
-
I need some custom host server logic to redirect the visitor to the correct profile page.
WHAT I NEED TO KNOW
-
Where do I create this server logic? Do I write an AWS Lambda function here on Netlify?
-
How would this function be…? In order to find out which profile to open I would have to scan my database in order to find the user that matches the incoming domain… right?
-
What about SSL? I don’t need to worry about it, right? If the user has it, then redirects will work through HTTPS… if he doesn’t, through HTTP. Right?
Thanks a lot!