Suppose I get a custom domain, example.com, and want to use it for example.glitch.me. I’m using NameCheap as my registrar. I’d like to ensure that all of the following URLs work:
I don’t care much which of those is canonical or how they redirect or anything. As long as clicking on any of them serves my app that’s running at example.glitch.me.
The configuration on the Glitch side seems obvious: I specify both example.com and www.example.com as custom domains.
That makes some of the 4 variants above work but not all of them. (Extra weird: I’ve tried this with the same configuration for two different domains / Glitch apps and it’s a different subset of the 4 variants that work vs don’t work.)
What’s the right configuration to make all the URL variations work?
Oh! Interesting update! My “extra weird” parenthetical is no longer true and now it’s just consistently https://example.com that doesn’t work. Specifically:
http://example.com redirects to https://www.example.com/ which loads fine
http://www.example.com does not redirect and loads fine
https://example.com times out (ERR_CONNECTION_TIMED_OUT)
https://www.example.com does not redirect and loads fine
So it’s now just case 3 I need to figure out.
PS: I just had an idea! I’m changing (in my registrar’s config) the root (aka apex aka “@”) redirect to do a masked redirect from example.com to https://example.glitch.me. So far that’s not working but I’m not sure how long DNS takes to propagate. I’m also trying an unmasked redirect which would be less ideal but better than timing out. Stay tuned!
Thanks for posting all of this, I’m following along to see what ends up working and not working so I can make sure we update our help doc about this. It’s often hard to tell what the issue is because DNS propagation times are always so arbitrary.
Jenn shared your post with me. Setting up custom domains can be tricky - especially since each domain registrar may have a slightly different ui for dns config - but here is what I have found typically helps when you want to set up both an example.com and www.example.com:
Like Jenn said, its likley a DNS propogation issue. Depending on the host and a few other factors, it can take up to three days for records to update. You can check progress on a website like dnspropogation.net.
The fact that it’s failing everywhere and the TTL was minutes (currently 1 minute) makes me skeptical that I’m just waiting on propagation here. But if no one has other ideas, I shall sit tight for 3 days. If it still doesn’t work by Monday then either @tasha’s instructions are wrong or I misunderstood. (If anything jumps out at you from the screenshot from NameCheap above, let me know!)
PS: I thought of a thing to clarify in @tasha’s instructions. Do I put both the bare domain and the www version in the config on the Glitch side? That’s what I’ve done so far:
Interesting, I did not know that. Thanks @dreev and @jenn
@dreev when you started updating the dns config according to the guidance above, did you start from scratch? Or did you edit the existing records on Namecheap from what you had previously?
You may need to delete the records on Namecheap and then try adding them again, starting with the ANAME and then adding the CNAME.
I know that is really annoying - im sorry to put you through all this! But I have found that will typically help.
I’ve seen some guides that say to use something like @ in the name column to control the apex domain. Dunno if that’s consistent with the instructions for namecheap specifically. I mean just from pattern matching, one might wonder if this screenshot says that molecall.com.molecall.com resolves to 50.21.246.1.
I believe I did but I just did so again to be sure.
Oh ho, thank you. You’re right, it should be @ according to Namecheap’s help pages.
This is huge progress! I’m kind of back where I started but with a better error. Namely, everything works except https://molecall.com which gives ERR_SSL_PROTOCOL_ERROR in Chrome and SSL_ERROR_ACCESS_DENIED_ALERT in Firefox. I.e., there’s apparently no SSL certificate for molecall.com?
To review for anyone just tuning in or as a sanity check, here are the steps I’m taking to get my custom domain (molecall.com) to point to molecall.glitch.me and have all four variants (http vs https and www vs root) work:
Oh nice, we’re so close! Okay, so since http is working with molecall.com and https is not, this means the final piece is the SSL cert which is done automatically on the Glitch + Fly.io end. It also sometimes takes time but if you don’t see it working in an hour, try removing “molecall.com” from your Glitch app and re-adding it (don’t touch Namecheap).
It works now! Thank you so much for the help, everyone. It looks like Glitch / Fly.io caught up with the missing SSL cert on its own – I didn’t have to delete and re-add molecall.com in the Glitch config.
So I believe my instructions above [now below] are correct and I’m now repeating them for two other domains…
I’m now adding some edits and clarifications in the above [now below] instructions. I think it would make sense to incorporate them into the official instructions.
I believe the existing official instructions are great if you have a specific subdomain of your custom domain that you want to use. If not then you’ll surely want both the root domain and the www version to work and of course you’ll want it to work for both http and https. As far as I can tell, only those with a profound understanding of sysadminnery could immediately infer the instructions below from what’s currently in the official instructions. (I mean, I have a PhD in computer science and it was a pretty huge frustration for me to piece it all together!)
Final Instructions
[moved again as I’ve learned new things and to keep it all as a single coherent set of step-by-step instructions! see new final response below.]
Open Questions
Is it fragile to hardcode the IP address? Is there any way to avoid doing so?
What if I’m morally opposed to non-encrypted websites and want the http version to actively redirect to the https version?
Which should be the canonical version of the URL? (I hear it’s important for googly/SEO reasons to pick one and have all others redirect to it.)