If you need to modify the parameters in URLs of the access requests sent to the origin, you can create rules to rewrite parameters. This topic describes how to create parameter rewrite rules in the CDN console.
When the parameters in a request URL are inconsistent with the parameters that you want to send to the origin, you can create parameter rewrite rules. These rules allow you to ignore, add, delete, retain, and modify the parameters.
- Log on to the Alibaba Cloud CDN console.
- In the left-side navigation pane, click Domain Names.
- On the Domain Names page, find the target domain name and click Manage.
- In the left-side navigation pane of the specified domain name, click Back-to-origin.
- Click the Parameter Rewrite tab.
- On the Parameter Rewrite tab, turn on Rewrite Parameters.
- You can configure different types of rewrite rules or press Enter to specify multiple
parameters for a rewrite rule based on your business needs.
- Click OK to apply and run the rewrite rules.
To modify the existing rewrite rules, click Modify on the Parameter Rewrite tab.Notice
When you configure parameter rewrite rules, note the following:
- The priorities of the following rewrite rules are in descending order: the Add rule, the Delete rule, the Reserve Only rule, and the Modify rule.
- The Ignore Parameters feature and the Reserve Only rule are mutually exclusive. Do not configure them at the same time to avoid feature conflicts.
- If you turn on Ignore Parameters and leave the Reserve Only field empty, all parameters included in the original request URLs will be ignored. However, the Add rule and the Delete rule still take effect because they have higher priorities.
- If you enter parameters in the Reserve Only field and turn off Ignore Parameters, only the specified parameters are retained in the original request URLs. However, the Add rule and the Delete rule still take effect because they have higher priorities.
The parameter rewrite feature conflicts with other features as follows:
- The Parameter Rewrite feature rewrites the parameters in request URLs, which may conflict with a URI Rewrite rule whose flag is set to enhance_break. If you configure both features, make sure that no conflicts exist.
- The Parameter Rewrite feature rewrites parameters in request URLs, which may conflict with the settings of the Retain Parameters or Ignore Parameters feature on the page. If you configure the three features at the same time, make sure that no conflicts exist.
- The Parameter Rewrite feature functions at the CDN nodes that communicate with the origin, which does not affect the internal links of CDN or rewrite the Cache Key. The Retain Parameters or Ignore Parameters feature functions at the CDN edge nodes, which affects the internal links of CDN and rewrites the Cache Key.