If the parameters in a request URL differ from those you want to send to your origin server, you can rewrite the parameters for origin fetch requests. You can add, delete, retain, or modify specific parameters, or ignore all parameters.
Background information
A URL parameter consists of one or more
name/valuepairs appended to a URL. The parameters are preceded by a question mark (?) and use thename=valueformat. If a URL contains multiple parameters, they are separated by an ampersand (&).A URL can also contain a
#symbol and the characters that follow the#symbol. The#symbol represents a location on a web page, and the characters that follow it are the identifier for that location. The#symbol is used to direct the browser's navigation. This information is not used by the server and is therefore not included in origin requests. After the browser reads the#symbol and the characters that follow it, it automatically navigates to that location. For example, inhttp://www.example.com/index.html#segment,#segmentrepresents thesegmentlocation on theindex.htmlpage. When a browser opens the page for this URL, it automatically navigates to this location.
Parameter priority
Parameter rewriting modifies the query parameters in the URL of an origin fetch request. You can configure multiple rewrite operations. The operations are applied in the following order of priority: Add > Delete Parameter > Reserve Only > Modify. If you configure different operations for the same parameter, only the operation with the highest priority takes effect.
If Ignore All Parameters is enabled, only the Add Parameter operation takes effect.
Conflict notes
The Parameter Rewrite feature may conflict with the enhance break rule of Rewrite origin fetch URL and the Ignore parameters feature. Avoid these conflicts during configuration. The last configured feature takes precedence.
Impact on cache keys
The Parameter Rewrite feature runs on Alibaba Cloud CDN points of presence (POPs) that handle origin fetch. This does not affect internal Alibaba Cloud CDN links or rewrite cache keys.
The Ignore parameters feature runs on Alibaba Cloud CDN POPs that handle edge requests. This affects internal Alibaba Cloud CDN links and rewrites cache keys.
Procedure
Log on to the Alibaba Cloud CDN console.
In the left-side navigation pane, click Domain Names.
On the Domain Names page, find the domain name that you want to manage and click Manage in the Actions column.
In the navigation pane on the left for the domain name, click Origin Fetch.
Click the Parameter Rewrite tab.
Turn on the Feature Switch.
Configure the origin fetch parameters that you want to rewrite.
Configure the rewrite operations as required. You can add multiple parameters for each operation in the text box. For more information, see Configuration examples.
Click OK. The rewrite operations take effect.
You can also click Modify on the Parameter Rewrite page to modify the existing rules.

Configuration examples
Example 1: Ignore all parameters.

Configuration item
Example value
Ignore parameters
On
Add parameter
None
Delete parameter
None
Retain only
None
Modify parameter
None
Rule condition
Not used
Result
Original request:
http://example.com/index.html?code1=1&code2=2&code3=3Rewritten origin fetch request:
http://example.com/index.htmlExample 2: Retain specified parameters.

Configuration item
Example value
Ignore parameters
Off
Add parameter
None
Delete parameter
None
Retain only
code2
Modify parameter
None
Rule condition
Not used
Result
Original request:
http://example.com/index.html?code1=1&code2=2&code3=3Rewritten origin fetch request:
http://example.com/index.html?code2=2Example 3: Add, delete, and modify parameters.

Configuration item
Example value
Ignore parameters
Off
Add parameter
code4=4
Delete parameter
code2
Retain only
None
Modify parameter
code3=0
Rule condition
Not used
Result
Original request:
http://example.com/index.html?code1=1&code2=2&code3=3Rewritten origin fetch request:
http://example.com/index.html?code1=1&code3=0&code4=4