isredirect Element

Redirect the browser to a specified URL.

location = target_url

Allowed data type: string or expression.

target_url specifies a target URL used by the browser to send a new request.

permanent = "true" | "false"

false is the default

Allowed data type: string or expression.

  • true causes the system to generate an HTTP 301 response code.
  • false causes system to generate an HTTP 302 response code.

If the permanent attribute isn't provided, false is the default .

<isredirect> appears before <iscache> in templates, because it clears the response created up to that point.

The following example checks whether the buyer has enabled cookies in their browser or not. Depending on the result, the browser is redirected.

Some browsers don't support redirect from HTTP to HTTPS. In such a case use the HTML meta tag "refresh", for example: