If the parameters in a user's request URL differ from those you want to send to your origin server, use the origin fetch parameter rewrite feature. This helps you modify the parameters in the URL of an origin request and lets you perform operations such as ignoring, adding, deleting, retaining, and modifying parameters.
Background information
URL parameters are one or more
name/valuepairs appended to a URL. They follow a?character and use thename=valueformat. Multiple parameters are separated by an&character.A URL can also include a
#character and the text that follows it. The#character directs a browser to a specific location on a web page.For example, in
http://www.example.com/index.html#segment, the#segmentpart points to thesegmentlocation on theindex.htmlpage. When a browser opens the URL, it automatically navigates to that location.
Parameter priority
The origin fetch parameter rewrite feature modifies the query parameters of an origin fetch request URL. You can configure multiple rewrite operations. The operations are prioritized as follows: Add > Delete > Reserve Only > Modify. If you apply different operations to the same parameter, only the operation with the highest priority takes effect.
When Ignore Parameters is enabled, Add is the only rewrite operation that remains effective.
Conflicts
The Parameter Rewrite feature, the enhance break rule of the Rewrite Origin Fetch URL feature, and the Ignore Parameters feature may conflict with each other. When you configure these features, be aware that the feature configured last takes precedence.
Impact on cache keys
The Parameter Rewrite feature is performed on CDN origin fetch points of presence (POPs). It does not affect CDN internal links or rewrite the cache key.
The Ignore Parameters feature is executed on CDN POPs. This feature affect the internal routing of CDN and rewrites the cache key.
Procedure
Log on to the CDN console.
In the left navigation pane, click Domain Names.
On the Domain Names page, find the target domain name and click Manage in the Actions column.
In the navigation pane for the domain name, click Origin Fetch.
Click the Parameter Rewrite tab.
Turn on the Feature Switch switch.
Configure the origin fetch parameters that you want to rewrite.
As needed, configure the rewrite operations based on the on-page instructions. You can add multiple parameters in the text box for an operation type. For more information, see Configuration examples.
Click OK. The rewrite operations are executed and take effect.
You can also click Modify on the Parameter Rewrite page to modify existing rules.

Configuration examples
Example 1: Ignore all parameters.

Configuration Item
Example Value
Ignore Parameters
Enabled
Add
None
Delete
None
Reserve Only
None
Modify
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 a specific parameter.

Configuration Item
Example Value
Ignore Parameters
Disabled
Add
None
Delete
None
Reserve Only
code2
Modify
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
shutdown
Add
code4=4
Delete
code2
Reserve Only
None
Modify
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