Skip to main content

Redirect not working in Redirect UI for a relative path redirect

Symptoms

  • Redirect not working as expected after adding rule and activating in the Redirect UI

  • Redirect which matches a relative path using the regex type match.

    • For example, ^/foo/bar$

  • Regex pattern appears valid 

Cause

Regex matches match against the FQDN of the request URI, meaning the protocol, domain, and query parameters are included in the string the regex is applied to. If an anchor is used at the beginning followed by a relative path, this will not match since the first characters in the string are http.

Solution

Replace the path with an FQDN for example:

^http(s)://www.domain.com/foo/bar$

More Information

Configuring URL redirects