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.
IN THIS ARTICLE
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
- For a public URL move, create a scoped Single Redirect with the correct destination and status. Test query preservation and prevent loops.
- For an internal path or query transformation, open the appropriate URL Rewrite Rule workflow and match only the intended request.
- Specify the static or supported dynamic rewrite and keep origin host routing requirements separate from path rewriting.
- Test the browser address, the response Location header and the origin log path to confirm which behaviour occurred.
- 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.