Cloudflare Docs
Rules
Rules
Edit this page
Report an issue with this page
Log into the Cloudflare dashboard
Set theme to dark (⇧+D)

Rewrite URL query string of blog visitors

To rewrite a request to the /blog path to /blog?sort-by=date, create a rewrite URL rule with the following settings:

Text in Expression Editor:

http.request.uri.path == "/blog"

Text after Query > Rewrite to… > Static:

sort-by=date

Additionally, set the path rewrite action of the same rule to Preserve so that the URL path does not change.