Www CNAME return HTTP 301

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

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?

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

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.

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

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

1 Like

Many thanks - works like a charm!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.