> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scanova.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Conditional Redirection 

> Defines redirection conditions for the Website URL QR Code category. Enables dynamic URL redirects based on user attributes such as device type, operating system, country, or language.

## Overview

The **Conditional Redirection Component** allows you to configure **custom redirect rules** for your Website URL QR Code.\
When a user scans the QR code, the system evaluates defined conditions (e.g., “if device = iOS, redirect to App Store”) and routes the user to the corresponding URL.

This helps deliver **personalized and context-aware experiences** — ideal for marketing campaigns, localization, or app redirections.

## Properties

| Property | Type            | Required | Description                                                                                               |
| :------- | :-------------- | :------- | :-------------------------------------------------------------------------------------------------------- |
| **type** | `string`        | ✅ Yes    | Defines the condition type used for redirection. Supported values: `os`, `device`, `country`, `language`. |
| **data** | `array<object>` | ✅ Yes    | Contains one or more condition-value pairs with associated URLs for redirection.                          |

***

### 🧩 **Data Object**

| Sub-Property | Type     | Required | Description                                                                                         |
| :----------- | :------- | :------- | :-------------------------------------------------------------------------------------------------- |
| **name**     | `string` | No       | Human-readable name or label for the condition (e.g., “Android”, “France”, “Spanish”).              |
| **url**      | `string` | ✅ Yes    | Destination URL to redirect to when this condition is matched. Must be a valid URI (HTTP or HTTPS). |

## Used In Categories

This component is used in the following QR Code category:

* [Website URL](/guides/category-components/categories/url)

## Example Schema

<CodeGroup>
  ```json Schema theme={null}
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "definitions": {},
    "title": "conditional urls",
    "type": "array",
    "additionalProperties": false,
    "description": "Conditions for redirecting the website.",
    "minItems": 1,
    "items": {
      "type": "object",
      "required": [
        "type",
        "data"
      ],
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "os",
            "device",
            "country",
            "language"
          ]
        },
        "data": {
          "type": "array",
          "description": "Contains data for condition types.",
          "minItems": 1,
          "maxItems": 50,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri",
                "title": "URL",
                "pattern": "(http://www\\.|https://www\\.|http://|https://)?[a-z0-9]+([\\-.][a-z0-9]+)*\\.[a-z]{2,10}(:[0-9]{1,5})?(/.*)?$",
                "description": "Used for redirecting user to the URL"
              }
            }
          }
        }
      }
    }
  }
  ```
</CodeGroup>

## Notes

* The system evaluates each condition **in order of definition** and redirects to the **first matching URL**.
* All URLs must be valid and **publicly accessible via HTTP/HTTPS**.
* You can define up to **50 redirection rules** per condition type.
* If no match is found, the user will be redirected to the **default URL** defined in the primary category data.
