All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ESA::RewriteUrlRule

Last Updated:Jul 06, 2026

The ALIYUN::ESA::RewriteUrlRule resource adds a URL rewrite configuration for a site.

Syntax

{
  "Type": "ALIYUN::ESA::RewriteUrlRule",
  "Properties": {
    "SiteId": Integer,
    "QueryString": String,
    "RewriteUriType": String,
    "RuleEnable": String,
    "RewriteQueryStringType": String,
    "Rule": String,
    "RuleName": String,
    "SiteVersion": Integer,
    "Uri": String
  }
}

Properties

Parameter

Type

Required

Update allowed

Description

Constraints

SiteId

Integer

Yes

No

The site ID.

None

QueryString

String

No

Yes

The query string that replaces the one in the original request.

None

RewriteQueryStringType

String

No

Yes

The rewrite type for the query string.

Valid values:

  • static: static mode.

  • dynamic: dynamic mode.

RewriteUriType

String

No

Yes

The rewrite type for the URI.

Valid values:

  • static: static mode.

  • dynamic: dynamic mode.

Rule

String

No

Yes

The content of the rule.

A conditional expression used to match user requests. This parameter is not required when adding a global configuration. Two use cases are supported:

To match all incoming requests, set the value to true.

To match a specific request, set the value to a custom expression, such as (http.host eq "video.example.com").

RuleEnable

String

No

Yes

Specifies whether to enable the rule.

This parameter is not required when you add a global configuration. Valid values:

  • on: Enables the rule.

  • off: Disables the rule.

RuleName

String

No

Yes

The name of the rule.

This parameter is not required when you add a global configuration.

SiteVersion

Integer

No

No

The version number of the site configuration.

For a site with configuration version management enabled, use this parameter to specify the version in which the configuration takes effect. The default version is 0.

Uri

String

No

Yes

The URI that replaces the path in the original request.

None

Return values

Fn::GetAtt

  • RewriteUriType: The rewrite type for the URI.

  • RuleEnable: Indicates whether the rule is enabled.

  • RewriteQueryStringType: The rewrite type for the query string.

  • QueryString: The query string that replaces the one in the original request.

  • Sequence: The execution order of the rule. A smaller value indicates a higher priority.

  • Rule: The content of the rule, which uses a conditional expression to match user requests.

  • ConfigId: The configuration ID.

  • Uri: The URI that replaces the path in the original request.

  • ConfigType: The configuration type, which indicates whether the configuration is global or feature-specific.

  • SiteVersion: The version number of the site configuration.

  • RuleName: The name of the rule.

Examples

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  SiteId:
    Type: Number
    Description:
      en: The site ID, which can be obtained by calling the [ListSites](https://www.alibabacloud.com/help/en/doc-detail/2850189.html) operation.
    Required: true
  RewriteUriType:
    Type: String
    Description:
      en: |-
        The rewrite type for the URI. Valid values:
        - `static`: static mode.
        - `dynamic`: dynamic mode.
    AllowedValues:
      - static
      - dynamic
    Required: false
  RuleEnable:
    Type: String
    Description:
      en: |-
        Specifies whether to enable the rule. You do not need to set this parameter when adding a global configuration. Valid values:
         - `on`: Enables the rule.
         - `off`: Disables the rule.
    AllowedValues:
      - 'on'
      - 'off'
    Required: false
  RewriteQueryStringType:
    Type: String
    Description:
      en: |-
        The rewrite type for the query string. Valid values:
        - `static`: static mode.
        - `dynamic`: dynamic mode.
    AllowedValues:
      - static
      - dynamic
    Required: false
  QueryString:
    Type: String
    Description:
      en: The query string that replaces the one in the original request.
    Required: false
  Rule:
    Type: String
    Description:
      en: |-
        The content of the rule, which uses a conditional expression to match user requests. You do not need to set this parameter when adding a global configuration. Two use cases are supported:
         - To match all incoming requests, set the value to `true`.
         - To match a specific request, set the value to a custom expression, for example, `(http.host eq "video.example.com")`.
    Required: false
  Uri:
    Type: String
    Description:
      en: The URI that replaces the path in the original request.
    Required: false
  SiteVersion:
    Type: Number
    Description:
      en: The version number of the site configuration. For a site with configuration version management enabled, use this parameter to specify the site version in which the configuration takes effect. The default version is 0.
    Required: false
  RuleName:
    Type: String
    Description:
      en: The name of the rule. You do not need to set this parameter when adding a global configuration.
    Required: false
Resources:
  ExtensionResource:
    Type: ALIYUN::ESA::RewriteUrlRule
    Properties:
      SiteId:
        Ref: SiteId
      RewriteUriType:
        Ref: RewriteUriType
      RuleEnable:
        Ref: RuleEnable
      RewriteQueryStringType:
        Ref: RewriteQueryStringType
      QueryString:
        Ref: QueryString
      Rule:
        Ref: Rule
      Uri:
        Ref: Uri
      SiteVersion:
        Ref: SiteVersion
      RuleName:
        Ref: RuleName
Outputs:
  RewriteUriType:
    Description: The rewrite type for the URI.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RewriteUriType
  RuleEnable:
    Description: Indicates whether the rule is enabled.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RuleEnable
  RewriteQueryStringType:
    Description: The rewrite type for the query string.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RewriteQueryStringType
  QueryString:
    Description: The query string that replaces the one in the original request.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - QueryString
  Sequence:
    Description: The execution order of the rule. A smaller value indicates a higher priority.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Sequence
  Rule:
    Description: The content of the rule, which uses a conditional expression to match user requests.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Rule
  ConfigId:
    Description: The configuration ID.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ConfigId
  Uri:
    Description: The URI that replaces the path in the original request.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Uri
  ConfigType:
    Description: The configuration type, which indicates whether the configuration is global or feature-specific.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ConfigType
  SiteVersion:
    Description: The version number of the site configuration.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SiteVersion
  RuleName:
    Description: The name of the rule.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RuleName
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "SiteId": {
      "Type": "Number",
      "Description": {
        "en": "The site ID, which can be obtained by calling the [ListSites](https://www.alibabacloud.com/help/en/doc-detail/2850189.html) operation."
      },
      "Required": true
    },
    "RewriteUriType": {
      "Type": "String",
      "Description": {
        "en": "The rewrite type for the URI. Valid values:\n- `static`: static mode.\n- `dynamic`: dynamic mode."
      },
      "AllowedValues": [
        "static",
        "dynamic"
      ],
      "Required": false
    },
    "RuleEnable": {
      "Type": "String",
      "Description": {
        "en": "Specifies whether to enable the rule. You do not need to set this parameter when adding a global configuration. Valid values:\n - `on`: Enables the rule.\n - `off`: Disables the rule."
      },
      "AllowedValues": [
        "on",
        "off"
      ],
      "Required": false
    },
    "RewriteQueryStringType": {
      "Type": "String",
      "Description": {
        "en": "The rewrite type for the query string. Valid values:\n- `static`: static mode.\n- `dynamic`: dynamic mode."
      },
      "AllowedValues": [
        "static",
        "dynamic"
      ],
      "Required": false
    },
    "QueryString": {
      "Type": "String",
      "Description": {
        "en": "The query string that replaces the one in the original request."
      },
      "Required": false
    },
    "Rule": {
      "Type": "String",
      "Description": {
        "en": "The content of the rule, which uses a conditional expression to match user requests. You do not need to set this parameter when adding a global configuration. Two use cases are supported:\n - To match all incoming requests, set the value to `true`.\n - To match a specific request, set the value to a custom expression, for example, `(http.host eq \\\"video.example.com\\\")`."
      },
      "Required": false
    },
    "Uri": {
      "Type": "String",
      "Description": {
        "en": "The URI that replaces the path in the original request."
      },
      "Required": false
    },
    "SiteVersion": {
      "Type": "Number",
      "Description": {
        "en": "The version number of the site configuration. For a site with configuration version management enabled, use this parameter to specify the site version in which the configuration takes effect. The default version is 0."
      },
      "Required": false
    },
    "RuleName": {
      "Type": "String",
      "Description": {
        "en": "The name of the rule. You do not need to set this parameter when adding a global configuration."
      },
      "Required": false
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::ESA::RewriteUrlRule",
      "Properties": {
        "SiteId": {
          "Ref": "SiteId"
        },
        "RewriteUriType": {
          "Ref": "RewriteUriType"
        },
        "RuleEnable": {
          "Ref": "RuleEnable"
        },
        "RewriteQueryStringType": {
          "Ref": "RewriteQueryStringType"
        },
        "QueryString": {
          "Ref": "QueryString"
        },
        "Rule": {
          "Ref": "Rule"
        },
        "Uri": {
          "Ref": "Uri"
        },
        "SiteVersion": {
          "Ref": "SiteVersion"
        },
        "RuleName": {
          "Ref": "RuleName"
        }
      }
    }
  },
  "Outputs": {
    "RewriteUriType": {
      "Description": "The rewrite type for the URI.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RewriteUriType"
        ]
      }
    },
    "RuleEnable": {
      "Description": "Indicates whether the rule is enabled.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RuleEnable"
        ]
      }
    },
    "RewriteQueryStringType": {
      "Description": "The rewrite type for the query string.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RewriteQueryStringType"
        ]
      }
    },
    "QueryString": {
      "Description": "The query string that replaces the one in the original request.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "QueryString"
        ]
      }
    },
    "Sequence": {
      "Description": "The execution order of the rule. A smaller value indicates a higher priority.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Sequence"
        ]
      }
    },
    "Rule": {
      "Description": "The content of the rule, which uses a conditional expression to match user requests.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Rule"
        ]
      }
    },
    "ConfigId": {
      "Description": "The configuration ID.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ConfigId"
        ]
      }
    },
    "Uri": {
      "Description": "The URI that replaces the path in the original request.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Uri"
        ]
      }
    },
    "ConfigType": {
      "Description": "The configuration type, which indicates whether the configuration is global or feature-specific.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ConfigType"
        ]
      }
    },
    "SiteVersion": {
      "Description": "The version number of the site configuration.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SiteVersion"
        ]
      }
    },
    "RuleName": {
      "Description": "The name of the rule.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RuleName"
        ]
      }
    }
  }
}