Custom domain simplification

I’m helping someone with a domain registered with GoDaddy and I would like to get a simple recap of the steps needed to link to a static site on Glitch.

I did read the instructions so I’m just trying to rephrase things a bit so I understand it. I don’t actually like instructions that suggest “you can do this… or you can do that” and prefer “just do this and then do that”.

The site was working BTW but it got broken recently by someone trying to “fix” it.

The Glitch custom domain has been set to www.testdomain.org (not the actual domain). I assume the only thing required on GoDaddy would be a CNAME record that directs www to glitch.edgeapp.net. So first question is am I correct in that assumption?

If so, this would only redirect www.testdomain.org requests. To get testdomain.org to work as well I assume I get GoDaddy to add the www and leave Glitch with the single www.testdomain set, correct?

And now I believe I have to add an A record with the IP address of glitch.edgeapp.net and then I can change the CNAME record with www to have an @ symbol rather than edgeapp url.

Does this sound correct? The A record redirects testdomain.org to glitch.edgeapp.net and the CNAME record handles the www case by redirecting to the A record.

Thanks. So many thing in the IT domain seem far more complicated than they need to be.

1 Like

My personal recommendation:

  • add www.testdomain.org as our domain on Glitch
  • add www CNAME glitch.edgeapp.net record on your nameserver
  • program your Glitch project to do an HTTP redirect from http to https
  • if your domain seller offers an HTTP redirect service, set one up on @ that:
  • if your domain seller does not offer an HTTP redirect service, set up a server of your own that does the HTTP redirection from testdomain.org in the same way. set up an A record for the IP address of that server. it may be possible to use Glitch to set up this server as well

Yea a good service I’ve found for this is https://redirect.pizza , I think it’d be good behavior for glitch to suggest the www domain when you add your domain without a subdomain.

Here’s what I ended up having to do in order to get all of the variants (http vs https, www vs root) to work:

Say you have custom domain example.com that you want to point to example.glitch.me.

  1. Add example.com and www.example.com as custom domains in Glitch. The order doesn’t matter.
Glitch config example screenshot

image

  1. Go to Domain Settings for example.com at your registrar. For Namecheap, choose “Namecheap BasicDNS”. Delete any existing domain redirects.

  2. Go to Advanced DNS settings (as it’s called in Namecheap) and delete any existing records.

  3. Add an A Record with host @ (meaning the root aka apex domain – example.com) and value 50.31.246.1 (the IP address for glitch.edgeapp.net – maybe double check this with any dnslookup or ping service). When testing and changing things, set the TTL to 1 minute. If you expect it to be stable, “Automatic” should be fine.

  4. Add a CNAME record with host www and value example.com. Same story with the TTL. (Note that Namecheap automatically turns example.com into example.com. with a trailing dot, which is expected.)

Registrar example config screenshot

  1. It normally will work now, within like a minute. If it doesn’t, check https://dnspropagation.net/A/example.com to see if the DNS records are propagating. If it doesn’t start working in 3 days then you can definitively rule out “slow DNS propagation” as the culprit.

  2. For SEO reasons you want search engines to know which of the URL variants is the canonical one. This is called URL canonicalization aka “rel canonical”. Namely, pick a variant – let’s say https://www.example.com – as the canonical version of the URL and specify it in the header of the HTML like so:

<head>
...
<link rel="canonical" href="https://www.example.com"/>
...
</head>

That way search engines will not be confused and penalize you for having seemingly the same content duplicated across 4 (actually 6, counting http://example.glitch.me and https://example.glitch.me) different URLs.

PS: The canonical version of these instructions are now here:

1 Like

Thank you. I wasn’t too far off. Nothing in the Glitch notes indicates that two variants of the custom domain should be entered. It won’t hurt obviously but I would guess (given the redirect) that the URL was www.example com by the time it got to Glitch. I’m going to try setting both of course.

And thanks for the canonical example. I would love to see more “documentation for dummies”. It isn’t that people are dummies but without examples and warnings and such there is so much that can go astray.

People are (for instance) generally not realizing that the prefix on the DNS record isn’t an identifier but that it is used. So someone entered “glitch” trying I suppose to remember this was entered for glitch and not realizing that glitch became a subdomain which the actual glitch project knew nothing about.

Yes they should read more and figure these things out but if a simple sentence or two can inform someone it is the better alternative.

1 Like

I wanted to thank you as well. I don’t use GoDaddy but if something is for sale I imagine they offer it :slight_smile: HTTP redirect can be step 2 once I get step 1 corrected. I rarely get involved prior to a problem manifesting itself and usually hear about it after it happened.

Setting DNS to CloudFlare is a possibility as well.

This one uses just uses DNS
http://redirect.center/
I’ve used it before and it works quite well

And obviously Cloudflare Page Rules work really well (what I use to redirect all my sites from www → @

1 Like

Appreciate the feedback. That said all DNS redirect solutions are following the same basic rules with A and CNAME records. It wasn’t hard to do with GoDaddy.

It redirects both http and https now. Without some other intervention it will not redirect the http connections to https automatically which would be nice perhaps but it is not a showstopper.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.