johnpatrickmorgan / wtfautolayout

The source code for Why The Failure, Auto Layout?
https://www.wtfautolayout.com
MIT License
1.08k stars 22 forks source link

www prefix doesn’t work with https #17

Closed ZevEisenberg closed 5 years ago

ZevEisenberg commented 5 years ago

I think @chrisballinger and I have identified an issue with HTTPS and subdomain redirects:

http://wtfautolayout.com ✅ (redirects to www) http://www.wtfautolayout.comhttps://wtfautolayout.com ❌ (hangs) https://www.wtfautolayout.com

johnpatrickmorgan commented 5 years ago

Thanks very much for spotting this, I'll have a look into it.

johnpatrickmorgan commented 5 years ago

I think this is a limitation of my current setup, where redirection from wtfautolayout.com to www.wtfautolayout.com is configured in the DNS provider (Namecheap), and SSL certs are managed via Heroku's Automated Certificate Management.

Heroku documents the issue here, and recommends using ANAME/ALIAS records for the redirection, but Namecheap doesn't support such records. I think I'd need to move DNS provider and manage redirection at the app level instead to resolve the issue, but I'm not sure it would be worth the complication.

Perhaps there's another solution though, as I'm not knowledgeable in this area.

chrisballinger commented 5 years ago

You can use free tier Cloudflare DNS for CNAME flattening and "Universal SSL": https://support.cloudflare.com/hc/en-us/articles/204144518-SSL-FAQ

johnpatrickmorgan commented 5 years ago

@chrisballinger Thanks so much, that looks like a much simpler solution.

Sent with GitHawk

johnpatrickmorgan commented 5 years ago

This has now been set up, and https://wtfautolayout.com should now redirect properly (thanks @akramhussein for your help). It's brought a number of other improvements too so thanks for raising this issue.