How to Use Two Domains in One App

I have two domains from Namecheap; hanihusam(dot)com and bapak2(dot)dev
I want those domains pointing to one app. How could I do that?

Go to the Certificates tab of your application, on the dashboard. Add the domains and you’ll have DNS values that you can set up on Namecheap to have them pointing to Fly.

1 Like

I’ve done that. Only one domain works. I use the same DNS value in both domains. When I try to open the failed one, I got this error on monitor tab (I guess it’s because of the failed domain that I open)

It also depends on how your application is set up. Is it configured to answer requests and support both domains you wish to use?

Which config do you mean?

I thought it’s just server and domain provider things.

Both domains seem to load fine at my end. Are you expecting one to redirect to the other though?

Really? I am still having problems open hanihusam(dot)com.

No. I just one each domain pointing into the same app.

I’m not familiar with the redirection part but about the domain not loading, have you tried clearing your browser cache or changing your DNS resolver?

Both domains appear to be resolving to Fly.io now.

curl -I https://hanihusam.com
HTTP/2 200
content-type: text/html; charset=utf-8
vary: Accept-Encoding
date: Tue, 11 Apr 2023 08:01:07 GMT
server: Fly/f8c3646c (2023-04-04)
via: 2 fly.io
fly-request-id: 01GXQNAD1MP78Z75V7A2D84DXW-nrt

curl -I https://bapak2.dev
HTTP/2 200
content-type: text/html; charset=utf-8
vary: Accept-Encoding
date: Tue, 11 Apr 2023 08:01:17 GMT
server: Fly/f8c3646c (2023-04-04)
via: 2 fly.io
fly-request-id: 01GXQNAPJE77ABR6HMDRAG8H0A-nrt

Depends on the app framework you are using. Some frameworks respond to all domains pointing to it, others you have to document some setting in code which domains you want the app responding to.

What do you mean? I am still getting issues opening hanihusam.com

Both domains load fine for me. Check what the domains are resolving to on your computer with nslookup.

nslookup hanihusam.com
nslookup bapak2.dev