Choosing a URL rewrite or browser redirect in Cloudflare

A redirect changes the browser’s URL by returning a redirect response. A URL rewrite changes the request path or query sent onward while the visitor continues to see the original address.

Information to have ready

Decide whether the public address is moving or whether the origin merely expects a different internal route. Review application-generated links, canonical URLs and cache behaviour before choosing the mechanism.

01 Choose a URL rewrite or browser redirect in Cloudflare

  1. For a public URL move, create a scoped Single Redirect with the correct destination and status. Test query preservation and prevent loops.
  2. For an internal path or query transformation, open the appropriate URL Rewrite Rule workflow and match only the intended request.
  3. Specify the static or supported dynamic rewrite and keep origin host routing requirements separate from path rewriting.
  4. Test the browser address, the response Location header and the origin log path to confirm which behaviour occurred.
  5. Verify application links, assets, authorisation and cache keys after the transformation. Document the public-to-origin relationship for future troubleshooting.

Confirm the expected result

A redirect should visibly send the browser to the target. A rewrite should preserve the public address while the origin receives the intended transformed request.

Troubleshoot unexpected results

Rewriting does not move website files or automatically change the application’s own URL settings. A rewrite can also affect conditions evaluated in later rule phases. If a rewritten private route becomes publicly cached, correct the cache and access design before deploying it.

Which should I use for an article that permanently moved?

A deliberate permanent redirect usually expresses that public move. A silent rewrite is useful for internal routing, but it does not tell the browser that the resource now has a different address.

  • 0 Users Found This Useful
  • performance
Was this answer helpful?

Related Articles

Migrating a set of old URLs with Cloudflare Bulk Redirects

Bulk Redirects suits a reviewed list of old-to-new URL mappings. It requires both a redirect...

Diagnosing overlapping Cloudflare rules

Cloudflare evaluates different rule products in defined phases. Within a phase, terminating...

Creating a Cloudflare Single Redirect for an old URL

A Single Redirect can send visitors from one old URL to its intended replacement before the...

Rolling back a failed Cloudflare Worker deployment

A Worker rollback creates an active deployment using a previously deployed version. It can...

Attaching a Cloudflare Worker to a narrowly scoped route

A Worker route runs edge code for matching requests on a Cloudflare-managed hostname. Attach...