Rules allow you to automatically apply image transformations (such as resizing, filtering, or watermarking) based on patterns in the image URL.
By defining URL-based patterns, you can automate image optimization and simplify the way transformations are applied without modifying individual URLs manually.
Configuring Rules in Cloudimage
- Open the Cloudimage Admin Panel.
- Navigate to Image Settings.
- Click Rules.
Below you can see examples of transformation rules configured in the interface.
Configuring Rules in Filerobot (DAM)
- Open the Filerobot Asset Hub.
- Click the Settings icon in the top-right corner.
- In the left panel, under Optimization, click Delivery.
- Open the Rules section.
- Click Add Rule to create a new rule.
Filerobot (DAM) supports Regex-based rules, allowing complex URL patterns to be simplified while keeping assets organized and accessible.
For example, you can create a rule matching:
.png
and apply parameters such as:
wat=1&radius=50
This means that whenever the system detects a URL containing .png, the defined transformation parameters will automatically be applied.
Important behavior of Rules
Regular expressions (Regex) and special characters are currently not supported in Cloudimage.
Rules operate on the part of the URL that appears after the /v7/ segment.
Example URL:
https://token.cloudimg.io/v7/__aliasname__/sampleimage.jpg
The Rules function receives only:
__aliasname__/sampleimage.jpg
Because of this behavior:
- A rule matching __alias__ will work
- A rule matching /__alias__ will fail because the slash does not exist in the processed string
For the same reason, please avoid creating rules that match:
- Your project token
- CNAME values
- Keywords such as cloudimg, filerobot, or v7
Avoid overlapping rule names
Do not create rules with similar patterns such as:
_demo_ __demo__
Similar patterns may cause unintended rule matching. For example, a rule designed for _demo_ may also match __demo__.
Rules and Aliases
Aliases are used to shorten or hide parts of the origin URL.
Cloudimage Rules do not evaluate the full origin URL. They only analyze the path after /v7/.
Example:
https://token.cloudimg.io/v7/__alias__/demoimage.jpg
If the alias __alias__ points to:
www.original-domain.com
The rule must match the alias name, not the original domain.
Using Rules with Presets
Rules can also be combined with presets.
For example, you can create a preset that applies a watermark and then use a rule to trigger that preset automatically. This allows you to apply transformations without exposing them in the public image URL.
Need help?
- Project/Token
- Short description of the issue
- Example URLs
- Screenshots or short video (if available)
- Steps to reproduce the issue
Comments
Please sign in to leave a comment.