Respond to the client request with a redirect without contacting the origin.

How it works

With this behavior enabled, you can offload your origin from specified redirects and speed up the performance for end-users.

Features and options

Field

What it does

Sub-options

Redirect Type

Redirect specifically for mobile sites or for all sites.

**

  • Default
  • Mobile
**

Destination Protocol

Select the protocol of the redirect destination URL.

**

  • Same as request
  • HTTP
  • HTTPS
**

Destination Hostname

Specify how to change the requested hostname.

  • Same as request
  • Add subdomain to request
  • Substitute requested subdomain
  • Static hostname

Subdomain to Add

With Destination Hostname set to Add subdomain to request, specify the subdomain to prepend the requested hostname. For example, to redirect from www.example.com to m.www.example.com, enter m.
Variable Support: This option supports variable expression syntax. Typing {{ in the option field triggers variable auto complete. Learn more about variable support.

Substitute Subdomain

With Destination Hostname set to Substitute requested subdomain, specify the alternative subdomain to use instead of the requested subdomain. For example, to redirect from www.home.example.com to m.home.example.com, enter m.
Variable Support: This option supports variable expression syntax. Typing {{ in the option field triggers variable auto complete. Learn more about variable support.

Static Hostname

With Destination Hostname set to Static hostname, specify the static (absolute) hostname for the redirect destination URL.
Variable Support: This option supports variable expression syntax. Typing {{ in the option field triggers variable auto complete. Learn more about variable support.

Destination Path

Specify how to change the requested path.

  • Same as requested
  • Path Prefix and Suffix
  • Static Path

Path Prefix

With Destination Path set to Path Prefix and Suffix, specify any path components to prepend the requested path. For example, to redirect from /example/index.html to /prefix/example/index.html, enter /prefix.
Variable Support: This option supports variable expression syntax. Typing {{ in the option field triggers variable auto complete. Learn more about variable support.

Path Suffix Status

With Destination Path set to Path Prefix and Suffix, specify whether to include a suffix to your redirect destination.

  • Do not add suffix
  • Add a suffix

Path Suffix

With Path Suffix Status set to Add a suffix, specify the path components to append to the requested path.
Variable Support: This option supports variable expression syntax. Typing {{ in the option field triggers variable auto complete. Learn more about variable support.

Include Query String

Indicate whether to append the query arguments to the destination query string.

Redirect Status Code

Select the HTTP status code to use in the redirect response.

**

  • 301 Moved Permanently
  • 302 Found
  • 303 See Other
  • 307 Temporary Redirect
**

Tips and best practices

You can specify the redirect URL relative to the current root path, or as a fully qualified URL:

  • Fully Qualified URL
    This redirects requests matching the rule to that URL with protocol specified:
    http://www.example.com/example/path/file.ext

  • Relative to Current Root Directory, using a / prefix
    This redirects the request to a different specific path under the same host root directory, using the same protocol:
    /example/path/file.ext

You can also choose to ignore query request parameters, append request parameters to destination parameters, or prefer request parameters over the destination parameters, when available.

Related topics

See the Redirect Plus behavior, where you can use variables more flexibly to express the redirect’s destination.


Did this page help you?