---
schema_version: "1"
id: 4ccf05770317c2415b12e5fd1b79a9a27ae14e7e79634c9e6eabb18b1d5c5d1d
title: isredirect Element
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/b2c-commerce/guides/isml/b2c-isredirect.md
canonical_url: https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/b2c-isredirect.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: cdacd4002b90ac333c20b34ad2afcd71f1a1c2f75021186ded5d7b77a6abb90d
products:
  - Composable Storefront
  - Salesforce APIs
---
# isredirect Element

Redirect the browser to a specified URL.

## Syntax

```
<isredirect
  location  = target_url        \\required
  permanent = "true" | "false"  \\false is default
>
```

- 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.

**note:** If the permanent attribute isn't provided, `false` is the default .

## Purpose

**note:** `<isredirect>` appears before `<iscache>` in templates, because it clears the response created up to that point.

## Example

The following example checks whether the buyer has enabled cookies in their browser or not. Depending on the result, the browser is redirected.

```
<isif condition = "${request.httpCookies['UserID']}">
    <isredirect location="${URLUtils.url('LoginPanel-Start')}" permanent="false">
    <iselse>
<!--- cookies are not enabled --->
</isif>
```

Some browsers don't support redirect from HTTP to HTTPS. In such a case use the HTML meta tag "refresh", for example:

```
<html>
<head>
<meta http-equiv="refresh" content="0; URL='${URLUtils.url(...)}'">
```
