All Products
Search
Document Center

CDN:Rewrite origin fetch parameters

Last Updated:Aug 15, 2025

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/value pairs appended to a URL. The parameters are preceded by a question mark (?) and use the name=value format. 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, in http://www.example.com/index.html#segment, #segment represents the segment location on the index.html page. When a browser opens the page for this URL, it automatically navigates to this location.Parameter rewriting diagram

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

  1. Log on to the Alibaba Cloud CDN console.

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

  3. On the Domain Names page, find the domain name that you want to manage and click Manage in the Actions column.

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

  5. Click the Parameter Rewrite tab.

  6. Turn on the Feature Switch.

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

  8. Click OK. The rewrite operations take effect.

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

    image

Configuration examples

  • Example 1: Ignore all parameters.

    image

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

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

  • Example 2: Retain specified parameters.

    image

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

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

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

    image

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

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