Class URLRedirectMgr

URLRedirect manager class. Methods in this class generate URLRedirects based on the current configuration for Static, Dynamic and URLRedirect mappings in Commerce Cloud Digital.

Information used to calculate URLRedirects are determined from the current HTTP request. The URL which is used to find a redirect can be accessed with getRedirectOrigin().

PropertyDescription
redirect: URLRedirect (read-only)Returns an URLRedirect object, containing a location and status.
redirectOrigin: String (read-only)Returns the relative origin url (without protocol, port, hostname and site path information) which will be used in getRedirect() to calculate a redirect location for.

This class does not have a constructor, so you cannot create it directly.

MethodDescription
static getRedirect()Returns an URLRedirect object, containing a location and status.
static getRedirectOrigin()Returns the relative origin url (without protocol, port, hostname and site path information) which will be used in getRedirect() to calculate a redirect location for.

assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values

redirect: URLRedirect (read-only)

Returns an URLRedirect object, containing a location and status. The redirect is calculated based on origin url of current request and the configured Static, Dynamic and URLRedirect mappings for the requested site.


redirectOrigin: String (read-only)

Returns the relative origin url (without protocol, port, hostname and site path information) which will be used in getRedirect() to calculate a redirect location for.


static getRedirect(): URLRedirect

Returns an URLRedirect object, containing a location and status. The redirect is calculated based on origin url of current request and the configured Static, Dynamic and URLRedirect mappings for the requested site.

Returns:

  • URLRedirect containing the location and status code, null in case of no redirect was found

static getRedirectOrigin(): String

Returns the relative origin url (without protocol, port, hostname and site path information) which will be used in getRedirect() to calculate a redirect location for.

Returns:

  • relative origin url