All Collections
Widgets and Advanced How-to's
Creating 301 redirect or URL Forwarding using Cloudflare
Creating 301 redirect or URL Forwarding using Cloudflare
Charlene Abranilla avatar
Written by Charlene Abranilla
Updated over a week ago

What are Page Rules?

Page Rules give you granular, URL-based control of Cloudflare’s settings. The most important thing to know about Page Rules is that only one Page Rule will trigger on a URL, so it’s important to sort your Page Rules in priority order, and keep your most specific Page Rules at the top.

What patterns are allowed in Page Rules?

  • If you are using a Forwarding Page Rule, then you can map those wildcards to variables. In the forwarding URL, you can specify $1, $2 and so on that match the wildcards in the original URL, in order from left to right.

  • For example, you could forward http://*.example.com/* to http://$2.example.com/$1.jpg. This rule would match http://cloud.example.com/flare, which would end up being forwarded to http://flare.example.com/cloud.jpg.

Some helpful tips:

  • If you want to match both http and https, it is enough to write example.com. You don’t need to do *example.com.

  • If you want to match every page on a domain, you need to write example.com/*. It is not enough to write example.com.

  • Refer to Understanding and Configuring Cloudflare Page Rules for more details on Page Rule patterns.

Rules to try for complex old URLs

If your DNS is not already set up with Cloudflare, here is how to set up redirection using Cloudflare:

  1. Move your DNS for your domain to Cloudflare (guide)

  2. Make sure SSL/TLS is set to Full

  3. Add rules to redirect the URLs you want (guide)

If your domain is already connected to Super then you will not need to make any change at the Super end.

Did this answer your question?