Hubert Mijalski
Hubert Mijalski

Reputation: 243

Request from origin without www is redirected to SSL, but not if www is present

a website I am hosting on Heroku with a domain and SSL I've bought at Namecheap is not correctly set up by me. Right now it looks like this:

request to: example.com redirects to https://www.example.com

request to: www.example.com does not redirect to SSL

request to: https://example.com causes time out. Here's my redirect setup: enter image description here

Upvotes: 0

Views: 40

Answers (1)

SWETA KESUR
SWETA KESUR

Reputation: 321

Since you have bought SSL from Namecheap, you can configure it using Heroku SSL docs.

To redirect from example.com to https://www.example.com (You can use the forwarding functionality) Take a look at this answer: use both www and naked domain to point my heroku app

To redirect from example.com to https (SSL): you will have to create CNAME record as pointing to herokudns and not herokuapp

heroku domains
=== example Heroku Domain
example.herokuapp.com

=== example Custom Domains
Domain Name      DNS Target
---------------  --------------------------
example.com      <haiku>.herokudns.com
www.example.com  <haiku>.herokudns.com

Upvotes: 1

Related Questions