Redirect non-www to CNAME www

Hello,

For a hosted ecommerce application I was required to add a CNAME entry to point to their servers.

Therefore, I’ve changed the nameservers in my domain’s registrar panel to point to cloudflare, all good.
Then, I’ve added an entry as following: CNAME - www - ecommerce.com

It works fine by using http://**www**.mydomain.com, but how do I redirect http://mydomain.com to http://www.mydomain.com ?

I’ve added a page rule, but it doesn’t work

**http://mydomain.com/* -> 301 -> http://www.mydomain.com/$1**

The browser fails to find the domain

Check out #Tutorials, in particular

Redirect example.com to www.example.com