Redirect Non-www to www is not Working

dash-dns
#1

Hi, I am trying to redirect the traffic from non-www to www but it doesn’t work.
I am using heroku which provide only CNAME DNS so I am kind stuck with www

here is what I have on Page Rules:
myweb.com/* Forwarding URL: Status Code: 301 - Permanent Redirect, Url: http://www.myweb.com

When I check the myweb without www. it doesn’t redirect me to www.
I already checked other topics here with the same issue but I couldn’t use their fixes

#2

I just now noticed that non-www response code is (failed)

#3

The order of page rules matter, as only one page rule is triggered for any given URL. Is the above page rule the first of all your page rules?

#4

this is the page rules order

#5

When I was taking the screen shot I edited the order of the the rules, I made url forwarding first after it was second in order and it worked.
Thanks a punch

#6

Glad to hear this!

Anyway, the canonical redirect page rule should have:

From:
example.com/*
To:
https://www.example.com/$1

The * creates the capture group to be copied to where $1 is placed on the target URL, so that:

example.com/some-page-or-file/
is properly redirected to
www.exaample.com/some-page-or-file/

Also, the second page rule, if meant to make the whole site https, is not needed. You can set Always Use HTTPS to ON at the Dashboard > Crypto tab.