• 9
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

Current Situation

example.com == examplecom and so on because of spam

I've a Domain examplecom on GoDaddy and a SSL cert for it. The real application is hosted on Heroku at exampleherokuappcom. I also uploaded the SSL cert on heroku via this guide: Heroku SSL.

I want that the url always appends www. that you'll never access the 'naked' domain.

I use AWS Route 53 with the following Records:

  • [A] from examplecom to examples3bucket (the s3bucket is just a redirect to wwwexamplecom)
  • [CNAME] from wwwexamplecom to wwwexamplecomherokudnscom

Problem

If I access http://example.com, http://www.example.com or https://www.example.com everything works (I get always redirected to https://www.example.com). But If I open https://example.com you don't get redirected which is a known Problem with the s3buckets and route 53 because it can't handle https (that's what I read):

S3 won’t allow you to configure an SSL certificate, so you cannot easily use Route 53 to redirect your root domain in HTTPS. If you need to do this, consider using a DNS provider that offers CNAME/ALIAS records root domains. For more information see the Custom domains Dev Center article, or this blog post, which shows how to set up a SSL naked domain redirect. Source: devcenter.heroku.com/articles/route-53 (sorry I am not allowed to post more than 2 links)

My approach

The Blogpost from above was actually pretty helpful. So I've set up Cloudfront but it didn't work for me because I don't know what I should use as SSL Endpoint for heroku because I don't have one (I use the free of charge Heroku SSL). If I type heroku certs -a example I get:

Name | Common Name(s) | Expires | Trusted | Type

namedid-12345 | wwwexamplecom, examplecom | 2018-02-22 06:35 UTC | True | SNI

but no 'real' endpoint. Is probably www.example.com.heorkudns.com my endpoint?

In Route 53 I have a

  • [A] Record from example.com to <id-of-cloudfront>.cloudfront.net
  • Do I need also a CNAME?

Update 0

After days of research I couldn't find a way to do it with Cloudfront and Route53. Therefore, I switched to DNsimple. They provide an easy one click function for Heroku SSL. It took me about 5 minutes to

  • create an account
  • deposit the credit card
  • change the nameserver of my domain to point to DNsimple instead of Route 53
  • Copy my MX Records (don't forget them)
  • Set up Heroku SSL

After that it took about 2 hours (it can take up to 24 hours) until everything was active.

Now all domains get redirected to https://www.example.com

The only "bad" point of this solution is, that it costs minimum 5€ per month where cloudfront and route 53 would be cheaper.

Trending Tags