Rewrite Rule Not Redirecting

What is the name of the domain?

What is the issue you’re encountering

Rewrite rules don’t result in a redirect.

What steps have you taken to resolve the issue?

Verified the rule is running with Cloudflare Trace

What are the steps to reproduce the issue?

I created a rewrite rule to transform the request to lower case. I can see in Cloudflare Trace that it’s running and Trace shows it’s resulting in a 301 redirect. But in the browser it’s not having the desired effect.

Screenshot of the error

You won’t see it in the browser as it is rewriting the request on the way to the origin, it is not returning a redirect to the browser.

If you want to see it in the browser, you need to use a redirect rule.

1 Like

The difference between URL rewrite and URL redirect is explained in our docs:

  • URL rewrite: A server-side operation that converts a source URL into a target URL. It occurs before a web server has fully processed a request. A rewrite is not visible to website visitors, since the URL displayed in the browser does not change. Configure rewrite URL rules to perform rewrites on the Cloudflare global network without reaching your web server.
  • URL redirect: A client-side operation that converts a source URL into a target URL. It occurs after the web server has loaded the initial URL. In this case, a website visitor can notice the URL changing when the redirect occurs. Refer to Redirects to learn more about configuring redirects.

Take a look at Rewrite URL rules.