Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

CustomRule - Amplify

CustomRule

Describes a custom rewrite or redirect rule.

Contents

source

The source pattern for a URL rewrite or redirect rule.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Pattern: (?s).+

Required: Yes

target

The target pattern for a URL rewrite or redirect rule.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Pattern: (?s).+

Required: Yes

condition

The condition for a URL rewrite or redirect rule, such as a country code.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 2048.

Pattern: (?s).*

Required: No

status

The status code for a URL rewrite or redirect rule.

200

Represents a 200 rewrite rule.

301

Represents a 301 (moved permanently) redirect rule. This and all future requests should be directed to the target URL.

302

Represents a 302 temporary redirect rule.

404

Represents a 404 redirect rule.

404-200

Represents a 404 rewrite rule.

Type: String

Length Constraints: Minimum length of 3. Maximum length of 7.

Pattern: .{3,7}

Required: No

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.