Www CNAME return HTTP 301


#1

I have a CNAME www pointing to a Heroku hosted web app.
Instead of invoking my app it returns http 301
any ideas what might be the problem


#2

A 301 is a forwarder. You either have a Page Rule with a URL Forwarder, or Heroku is redirecting for some reason. It can also be a 301 to redirect to HTTPS.

What is the 301 forwarding you too?


#3

curl -I https://www.watt-analytics.com

HTTP/2 301

date: Sat, 09 Mar 2019 15:21:16 GMT

content-type: text/html

set-cookie: __cfduid=d82fd98073c90238a49f6e50120a6c34b1552144876; expires=Sun, 08-Mar-20 15:21:16 GMT; path=/; domain=.watt-analytics.com; HttpOnly; Secure

location: https://www.watt-analytics.com/

via: 1.1 vegur

expect-ct: max-age=604800, report-uri=“https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct

server: cloudflare

cf-ray: 4b4e09a53b0bcb9a-VIE


#4

So it’s stuck in a Redirect Loop. Quite possibly to force HTTPS.

What’s your SSL setting in the Cloudflare Crypto page? It’s either Flexible or Strict.


#5

it’s flexible - maybe both Cloudflair and Heroku do SSL redirect


#6

Heroku is probably doing SSL redirect. Have you tried Full SSL?


#7

Many thanks - works like a charm!