Cloudflare Error 1035 / 1036: Invalid request rewrite (invalid URI path / query string)

A Transform Rule (URL rewrite) produced an invalid path or query string.

Seen on: Cloudflare

Meaning

Rewrite expressions that build a path without a leading slash, include illegal characters, or create an invalid query string make Cloudflare reject the request.

Common causes

  • Rewrite expression produces a path without leading “/”
  • Invalid characters or encoding in the rewritten URL
  • Concat/regex_replace mistakes in the expression

⚡ Quick fix

  1. Test the rewrite expression with sample URLs
  2. Ensure the new path starts with /
  3. Disable the rule to confirm

Detailed fix by platform

Cloudflare

  1. bash
    # Rules → Transform Rules → Rewrite URL: example dynamic path
    concat("/v2", http.request.uri.path)

How to diagnose

  1. Rule — Which rewrite matched?
  2. Output — Resulting path/query

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.