Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,12 @@ Leave the **Query** > **Rewrite to** > _Static_ field empty.

## Pass every image requested on your zone through Images

:::note
This feature requires a Business or Enterprise plan to enable regular expressions in Transform Rules. Refer to [Cloudflare Transform Rules Availability](/rules/transform/#availability) for more information.
:::

This example lets you transform every image that is requested on your zone with the `format=auto` option:

```txt
(http.request.uri.path.extension matches "(jpg)|(jpeg)|(png)|(gif)") and (not (any(http.request.headers["via"][*] contains "image-resizing")))
(http.request.uri.path.extension in {"jpg" "jpeg" "png" "gif"}) and (not (any(http.request.headers["via"][*] contains "image-resizing")))
```

```txt title="Text in Path > Rewrite to > Dynamic"
regex_replace(http.request.uri.path, "/(.*)", "/cdn-cgi/image/format=auto/${1}")
concat("/cdn-cgi/image/format=auto", http.request.uri.path)
```