redirect

  • Property Manager name: Redirect
  • Behavior version: The v2023-09-20 rule format supports the redirect behavior v1.5.
  • Rule format status: GA, stable
  • Access: Read-write
  • Allowed in includes: Yes

Respond to the client request with a redirect without contacting the origin. Specify the redirect as a path expression starting with a / character relative to the current root, or as a fully qualified URL. This behavior relies primarily on destination_‚Äčhostname and destination_‚Äčpath to manipulate the hostname and path independently.

See also the redirectplus behavior, which allows you to use variables more flexibly to express the redirect's destination.

OptionTypeDescriptionRequires
mobile_‚Äčdefault_‚Äčchoiceenum

Either specify a default response for mobile browsers, or customize your own.

{"displayType":"enum","options":["DEFAULT","MOBILE"],"tag":"select"}
DEFAULT

Allows all other response_‚Äčcode values.

MOBILE

Allows only a 302 response code.

destination_‚Äčprotocolenum

Choose the protocol for the redirect URL.

{"displayType":"enum","options":["SAME_AS_REQUEST","HTTP","HTTPS"],"tag":"select"}
SAME_‚ÄčAS_‚ÄčREQUEST

Pass through the original protocol.

HTTP

Use http.

HTTPS

Use https.

destination_‚Äčhostnameenum

Specify how to change the requested hostname, independently from the pathname.

{"displayType":"enum","options":["SAME_AS_REQUEST","SUBDOMAIN","SIBLING","OTHER"],"tag":"select"}
SAME_‚ÄčAS_‚ÄčREQUEST

Preserves the hostname unchanged.

SUBDOMAIN

Prepends a subdomain from the destination_‚Äčhostname‚ÄčSubdomain field.

SIBLING

Replaces the leftmost subdomain with the destination_‚Äčhostname‚ÄčSibling field.

OTHER

Specifies a static domain in the destination_‚Äčhostname‚ÄčOther field.

destination_‚Äčhostname‚ÄčSubdomainstring (allows¬†variables)

Specifies a subdomain to prepend to the current hostname. For example, a value of m changes www.‚Äčexample.‚Äčcom to m.‚Äčwww.‚Äčexample.‚Äčcom.

destination_‚Äčhostname is SUBDOMAIN
{"displayType":"string","tag":"input","type":"text"}
{"if":{"attribute":"destinationHostname","op":"eq","value":"SUBDOMAIN"}}
destination_‚Äčhostname‚ÄčSiblingstring (allows¬†variables)

Specifies the subdomain with which to replace to the current hostname's leftmost subdomain. For example, a value of m changes www.‚Äčexample.‚Äčcom to m.‚Äčexample.‚Äčcom.

destination_‚Äčhostname is SIBLING
{"displayType":"string","tag":"input","type":"text"}
{"if":{"attribute":"destinationHostname","op":"eq","value":"SIBLING"}}
destination_‚Äčhostname‚ÄčOtherstring (allows¬†variables)

Specifies the full hostname with which to replace the current hostname.

destination_‚Äčhostname is OTHER
{"displayType":"string","tag":"input","type":"text"}
{"if":{"attribute":"destinationHostname","op":"eq","value":"OTHER"}}
destination_‚Äčpathenum

Specify how to change the requested pathname, independently from the hostname.

{"displayType":"enum","options":["SAME_AS_REQUEST","PREFIX_REQUEST","OTHER"],"tag":"select"}
SAME_‚ÄčAS_‚ÄčREQUEST

Preserves the current path unchanged.

PREFIX_‚ÄčREQUEST

Prepends a path with the destination_‚Äčpath‚ÄčPrefix field. You also have the option to specify a suffix using destination_‚Äčpath‚ÄčSuffix and destination_‚Äčpath‚ÄčSuffix‚ÄčStatus.

OTHER

Replaces the current path with the destination_‚Äčpath‚ÄčOther field.

destination_‚Äčpath‚ÄčPrefixstring (allows¬†variables)

When destination_‚Äčpath is set to PREFIX_‚ÄčREQUEST, this prepends the current path. For example, a value of /prefix/path changes /example/index.‚Äčhtml to /prefix/path/example/index.‚Äčhtml.

destination_‚Äčpath is PREFIX_‚ÄčREQUEST
{"displayType":"string","tag":"input","type":"text"}
{"if":{"attribute":"destinationPath","op":"eq","value":"PREFIX_REQUEST"}}
destination_‚Äčpath‚ÄčSuffix‚ÄčStatusenum

When destination_‚Äčpath is set to PREFIX_‚ÄčREQUEST, this gives you the option of adding a suffix.

destination_‚Äčpath is PREFIX_‚ÄčREQUEST
{"displayType":"enum","options":["NO_SUFFIX","SUFFIX"],"tag":"select"}
{"if":{"attribute":"destinationPath","op":"eq","value":"PREFIX_REQUEST"}}
NO_‚ÄčSUFFIX

Specify if you want to preserve the end of the path unchanged.

SUFFIX

The destination_‚Äčpath‚ÄčSuffix provides the value.

destination_‚Äčpath‚ÄčSuffixstring (allows¬†variables)

When destination_‚Äčpath is set to PREFIX_‚ÄčREQUEST and destination_‚Äčpath‚ÄčSuffix‚ÄčStatus is set to SUFFIX, this specifies the suffix to append to the path.

destination_‚Äčpath‚ÄčSuffix‚ÄčStatus is SUFFIX
{"displayType":"string","tag":"input","type":"text"}
{"if":{"attribute":"destinationPathSuffixStatus","op":"eq","value":"SUFFIX"}}
destination_‚Äčpath‚ÄčOtherstring (allows¬†variables)

When destination_‚Äčpath is set to PREFIX_‚ÄčREQUEST, this replaces the current path.

destination_‚Äčpath is OTHER
{"displayType":"string","tag":"input","type":"text"}
{"if":{"attribute":"destinationPath","op":"eq","value":"OTHER"}}
query_‚Äčstringboolean

When set to APPEND, passes incoming query string parameters as part of the redirect URL. Otherwise set this to IGNORE.

{"displayType":"boolean","tag":"input","type":"checkbox"}
response_‚Äčcodeenum

Specify the redirect's response code.

{"displayType":"enum","options":["301","302","303","307"],"tag":"select"}
Supported values:
301
302
303
307