All Products
Search
Document Center

CDN:Rewrite origin fetch parameters

Last Updated:Nov 17, 2025

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/value pairs appended to a URL. They follow a ? character and use the name=value format. 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 #segment part points to the segment location on the index.html page. 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

  1. Log on to the CDN console.

  2. In the left navigation pane, click Domain Names.

  3. On the Domain Names page, find the target domain name and click Manage in the Actions column.

  4. In the navigation pane for the domain name, click Origin Fetch.

  5. Click the Parameter Rewrite tab.

  6. Turn on the Feature Switch switch.

  7. 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.

  8. Click OK. The rewrite operations are executed and take effect.

    You can also click Modify on the Parameter Rewrite page to modify existing rules.

    image

Configuration examples

  • Example 1: Ignore all parameters.

    image

    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=3

    Rewritten origin-fetch request: http://example.com/index.html

  • Example 2: Retain a specific parameter.

    image

    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=3

    Rewritten origin-fetch request: http://example.com/index.html?code2=2

  • Example 3: Add, delete, and modify parameters.

    image

    Configuration Item

    Example

    Ignore Parameters

    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=3

    Rewritten origin-fetch request: http://example.com/index.html?code1=1&code3=0&code4=4