Double Forward: From Github Pages to CloudFront

published on

Some of you may encouter this issue which is that there is some non-trivial configs needed to get both the apex domain and the www subdomain pointing to the same S3 bucket with CloudFront in front of it.

Well I took a simpler (and possibly inefficient option): which is to go to my registrar and add in a `A` entry pointing to Github's servers. Then created a github pages repo. This repo has a single index file which does both javascript as well as html based redirecting to the www domain. This www domain is configured with CloudFront and points to the public S3 bucket.

Looks messy isn't it? Well, it seems to be working and I don't want to fix what is not broken.