Last update:2026-03-12 14:20:27
When you configure Origin URL Rewrite in CDN, the CDN will rewrite the origin request URL according to your configured rewrite requirements when fetching content from the origin.


Apply to URL Pattern (Regex)
Matches client request URLs that meet the specified criteria. Regular expressions are supported, not required to start with /. The platform will automatically prefix the URL with ^https?://[^/]/, e.g., .*.jpg$, indicating that requests for JPG files across all domains associated with this rule will match this policy.
Origin Hostname
Only origin hostnames are supported; origin IP addresses are not supported.
The origin hostname can also be configured in Set Origin and Batch Modify Origin, but the effective priority is lower than this configuration. In other words, when the origin hostname is configured in multiple places, the value configured in Origin URL Rewrite takes effect.
Host Header
When you need to specify the hostname or domain name of the server that the client communicates with, you must configure the Host value, because different hostnames may share the same origin IP, and the origin server uses this value to determine which content to respond. After configuration, when there is a client request carrying Host value, the origin will respond content related to the hostname or domain.
For example, if the value is set at www.cdnetworks.net, an end-user request for www.testdomain.com could send www.cdnetworks.net in the Host header to the origin. Then the origin will respond with www.cdnetworks.net related content.
Host Header can also be configured in Set Origin, Batch Modify Origin and Host Header and Port, but the effective priority of all of them is lower than Origin URL Rewrite. If configured simultaneously, the configuration in Origin URL Rewrite takes effect.
Source URI
Enter the original path to be replaced, that is, the original URI content. Regular expressions are supported.
Make sure that the Source URI and the Target URI must both be configured for the rule to take effect.
Target URI
Enter the modified new path. The new path will replace the original path when fetching content from the origin. Regular expressions are supported.
Make sure that the Source URI and the Target URI must both be configured for the rule to take effect.
Case-Insensitive Match
a.jpg, then whether the client request URL is http://domain/a.jpg or http://domain/A.jpg, CDN will rewrite the origin request URL based on the rewrite requirements configured in this rule.a.jpg, when the client request URL is http://domain/a.jpg, it is considered a successful match and CDN will rewrite the origin request URL based on the rewrite requirements configured in this rule, while http://domain/A.jpg is considered not matched and CDN won’t rewrite the origin request URL.Priority
You can specify the priority level of this rule. The larger the number, the higher the priority. Based on the user’s request, the system matches the rules you have set. If multiple rules apply, the rule with the higher priority will be applied first.
After you have completed setting the configurations, please click OK and then select Next to submit your settings. To minimize any potential disruptions to your production environment, we strongly recommend conducting a Pre-deploy test in a staging environment. This crucial step ensures that your configurations are accurate before they go live. Once you have verified the accuracy of the settings, click Deploy Now to implement them in the live environment. The configurations typically become effective within 3-5 minutes. For comprehensive guidance on pre-deployment testing and to verify the effectiveness of your configurations, please consult the tutorial Deploy the Configurations to Staging Environment for Validation.
When the URL path requested by the user is exactly a.jpg, for example, http://your CDN domain/a.jpg, the CDN will rewrite the origin request URL:
/test/123.jpg in the original origin request URL with /123.jpgwww.testdomain.comThat is, the CDN origin request URL will become http://www.testdomain.com/123.jpg.
