Skip to content

Commit 611cbe4

Browse files
authored
Update serve-images-custom-paths.mdx
Simplify the expressions, the use of regex here does not make any sense.
1 parent a4e69c1 commit 611cbe4

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/content/docs/images/transform-images/serve-images-custom-paths.mdx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,12 @@ Leave the **Query** > **Rewrite to...** > *Static* field empty.
9898

9999
## Pass every image requested on your zone through Images
100100

101-
:::note
102-
103-
104-
This feature requires a Business or Enterprise plan to enable regex in Transform Rules. Refer to [Cloudflare Transform Rules Availability](/rules/transform/#availability) for more information.
105-
106-
107-
:::
108-
109101
This example lets you transform every image that is requested on your zone with the `format=auto` option:
110102

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

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

0 commit comments

Comments
 (0)