Page rules - Always use HTTPS and Redirect


#1

Hello, I’m trying to work out how to get page rules to work for our site, we’ve got 2 page rules spare.

We need to enforce https:// on all pages, with or without www. - e.g. http://domain.com and http://www.domain.com.

And we need to redirect all traffic from non-www to www.

I’ve tried the redirect one using * and $1, and it doesn’t seem to work - redirecting to /* actually literally redirects to /* and causes an error message.


#2

The easiest way to do this would be to enable

in the crypto tab.

From this article:

To fix the forwarding from the root to www in the above example, you could use the same pattern:

example.com/*

You’d then setup the following URL for traffic to forward to:

http://www.example.com/$1

In this case, if someone went to:

example.com/some-particular-page.html

They’d be redirected to:

http://www.example.com/some-particular-page.html

Looks from what you posted above like you got the * and the $1 the wrong way round.


#3

Thanks, that’s great, all working now.


#4

No problem, glad it’s working for you now.