Last update:2026-07-13 18:19:22
When users access your website content through the Atomile CDN platform, you can configure simple rules in the console to deliver specific content based on various criteria, such as the protocol of the request URL, request content, request headers, or even the user’s geographical location. Atomile currently supports rewriting request URLs or protocols by returning a specific status code and a new URL, prompting the client to initiate a new request.
Atomile allows you to enter a URL regular expression in the console through URL Pattern to determine whether a user request matches your rewriting rule. For example, rewrite/*.(jpg|png|gif) means that requests for jpg, png, or gif files in the rewrite directory match this rule.
In addition to configuring a URL regular expression as the basic matching condition for the rule scope, you can also add other conditions through Advanced Scope. You can select one or more of the following parameters as combined conditions. These conditions work together with the basic URL regex using an AND relationship to determine the final rule scope.
| Parameter | Description |
|---|---|
| UA or Exception UA | Supports regular expressions. Spaces and tab characters are converted to \s.Multiple UAs can be configured at the same time, with one UA per line. |
| Country or Exception Country | Supports direct selection from the list of countries or regions provided by Atomile. |
| Request Header or Exception Request Header | Enter the header name and its value. The value supports regular expressions, for example: Range bytes=[0-9]{9,}.Currently, only one request header can be configured per rule. |
| Exception URL (Regex) | Supports regular expressions. For example, if URL Pattern is rewrite/*.(jpg|png|gif) and this field is rewrite/*exception*.jpg, requests for jpg, png, or gif files in the rewrite directory match the rule, except requests containing *exception*.jpg. |
The Advanced Scope items marked with Exception indicate NOT conditions, which exclude specific cases from the basic matching scope. Each configuration item above can appear only once in a single rule. In addition, UA and Exception UA are mutually exclusive in one rule, and the same applies to Country and Exception Country. Therefore, a maximum of four advanced scope items can be configured in a single rule.
Atomile currently allows you to choose either Protocol Rewrite or URL Rewrite. Regardless of the selected type, you must choose the response status code to return to the client. Atomile supports the following status codes: 301, 302, 303, and 307. The default value is 302.
Protocol rewriting means that when the CDN edge node receives a client request, it rewrites the protocol and then uses the rewritten protocol for caching and origin requests. If you only want to rewrite the protocol used for origin requests, refer to Origin Protocol Rewriting for the related configuration.
In this rule, you can choose either Force HTTPS or Force HTTP, as shown below.
Like protocol rewriting, URL rewriting is performed when the CDN node receives a request. The rewritten URL is then used for caching and origin requests. If you only want to replace the host and port used for origin requests, refer to Origin Host Header and Origin Request Port for the related configuration.
For URL Rewrite, fill in Original Path with the request URL you want to rewrite. This field supports regular expressions or a complete URL, such as (https://[^/]+)/.* or http://domain/browse/index.html?aa=1. In Redirection Path, enter the rewritten path, which must begin with http:// or https://.
You can set the priority of this rule from 1 to 10. A higher number means a higher priority for matching and application. If multiple rules have identical matching conditions, only the rule with the higher priority is applied.
In addition to clicking Add to enter the detailed rule configuration page, you can also click Quick Configuration next to Add for simpler protocol or URL rewriting setup. In Quick Configuration, Effective Range defaults to all requests and the response status code defaults to 302. Other settings, such as the rewrite protocol, original URL, redirect URL, and priority, can still be customized.
After completing the configuration, click Confirm, and then click Next to submit it. To avoid affecting your production environment, we recommend performing a Pre-deploy test first in a staging environment. Once you confirm that the configuration is correct, click Deploy Now to apply it in the live environment. The configuration typically takes effect within 3 to 5 minutes. For more information about pre-deployment testing, refer to Deploy the Configurations to Staging Environment for Validation.
Force HTTPS and Force HTTP rules at the same time.