Naked url redirect to www on Spark

When users ask us the best way to set up their domain our standing recommendation is to go with https://www.yourdomain.com. Every site on Spark is required to be HTTPS because, well, it’s 2019, and every site should be secure.

When you set up your domain on Spark, you’ll create a CNAME record that points to www. Once this is resolving you’ll notice that if if you type in yourdomain.com in most browsers it will resolve to www.yourdomain.com. However, if users explicitly go to https://yourdomain.com it will show something like this.

image

We don’t want that, so let’s fix it! Fortunately, the fix very easy. I’ve created quick walk through steps below for AWS Route53 and will add more to this post soon.

For AWS:

  1. Go to your Route53 configuration where you set up Spark.
  2. Create a new A record and select the option Alias
  3. The value you add should be the same value as the www record

Once you save you should see it begin to resolve relatively quickly. Don’t worry if you see the value prepend “dualstack” to it. This is something that AWS automatically adds for ALIAS records.