Knowledgebase

Redirect Rules at Cloudflare Print

  • cloudflarecdn, cloudflare, redirects, domain, subdomain, htaccess, caching, guide
  • 0

Sending one address to another.

WHAT THEY DO

Redirect a URL or pattern to another, at the edge, before the request reaches us.

WHEN THIS IS USEFUL

Redirecting a parked domain to your main site Forcing www or non-www consistently Redirecting old URLs after a restructure Redirecting a retired subdomain

WHY AT CLOUDFLARE RATHER THAN IN HTACCESS

The request never reaches us, so it consumes none of your resources.

For a domain that exists only to redirect, this means you need no hosting for it at all.

THE CAUTION

Do not combine a Cloudflare redirect with one at our end doing the same thing. That produces a loop.

Choose one place.

FOR WWW CONSISTENCY

Pick one form, redirect the other, and make sure your application's site URL matches.

Three mechanisms disagreeing is the usual cause of a redirect loop.

PERMANENT VERSUS TEMPORARY

Use a permanent redirect for anything lasting, so search engines transfer the ranking.

TESTING

In a private window, since browsers cache redirects aggressively and will keep showing an old one.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot