---
name: azion-install-the-massive-redirect-integration
description: >-
  Install Massive Redirect from Azion Marketplace and run it on an application to manage a large set of URL redirects in one place.
---

# Install the Massive Redirect integration

Massive Redirect redirects a large set of URLs from one list of rules, and keeps every redirect in one place. Use it for a domain migration, a CMS or e-commerce platform migration, or a website upgrade, whatever the number of pages. It is one of the [Marketplace integrations](/en/documentation/platform/marketplace/integrations/) that run on an application.

Four objects must exist before a request is redirected: the installed function, an application with the **Functions** module turned on, a function instance that holds the redirects, and a Rules Engine rule with the **Run Function** behavior. Each section below creates one of them.

---

## Prerequisites

- An Azion account. To sign in, refer to [How to access Azion Console](/en/documentation/guides/platform/account-and-billing/how-to-access-azion-console/).
- An [application](/en/documentation/platform/applications/) served by a [workload](/en/documentation/platform/workloads/). To create one, refer to [Applications quickstart](/en/documentation/platform/applications/quickstart/).
- Turning on a product or a module can generate usage costs. For more information, refer to [Pricing](/en/documentation/fundamentals/pricing/).

---

## Install the integration

The install adds the Massive Redirect function to your account. To install it from Azion Console:

1. **Open Marketplace**

   Access [Azion Console](https://console.azion.com/) > **Marketplace**.

2. **Find the integration**

   Enter `Massive Redirect` in the **Search on Marketplace** field, then select the integration's card. Browsing the cards and the categories reaches the same page.

3. **Select Install**

The card shows `Successfully installed!` and `Latest version installed!`. The function is then listed as *Massive Redirect \[Global]* in the **Function** list of the **Create Instance** drawer.

---

## Turn on the Functions module

An application runs an installed function only when its **Functions** module is on. To turn on the module:

1. **Open your application**

   Access [Azion Console](https://console.azion.com/) > **Applications** > **your application**.

2. **Open the Modules section**

   In the **Main Settings** tab, go to the **Modules** section.

3. **Turn on the Functions switch**

4. **Select Save**

Azion Console confirms that the application was updated.

---

## Create the function instance

A function instance holds the redirects the Massive Redirect function applies for one application. To create the instance in your application:

1. **Open the Functions Instances tab**

   In **Applications**, select your application, then select the **Functions Instances** tab.

2. **Select + Function**

   An application with no instance yet offers the same action as **Function Instance**. The **Create Instance** drawer opens.

3. **Name the instance**

   In **Name**, enter a unique name that identifies the instance. For example: `massive-redirect-migration`.

4. **Select the function**

   In **Function**, select *Massive Redirect \[Global]*. The **Arguments** editor fills with the default arguments of the integration.

5. **Edit the arguments**

   In **Arguments**, replace the default redirects with your own. Each key is described in the table below.

6. **Select Save**

The instance appears in the **Functions Instances** tab with the name you entered.

### Arguments

The arguments are a JSON array. Each object in the array is one redirect, so one instance holds several redirects at the same time. The JSON file has a limit of 300 kb. The editor loads arguments like these:

```json
[
  {
    "from": "https://www.azion.com.br",
    "found": "https://www.azion.com"
  }, {
    "from_regex": "http://www\\.(azion)\\.com$",
    "moved": "https://www.%s.com"
  },{
    "from_regex":"http://www\\.azion\\.com/t/other/([\\w_]+)/([\\w_]+)/([\\w_]+)/$",
    "moved":"https://www.azion.com.br/doc/%3$/%1$/%2$/"
  }
]
```

Each redirect takes one source key and one target key:

| Key          | Description                                                                        |
| ------------ | ---------------------------------------------------------------------------------- |
| `from`       | The previous URL, the one that redirects to a new URL                              |
| `from_regex` | A pattern that matches several addresses, to pass several redirections in one line |
| `moved`      | The new URL, the target of a permanent redirect                                    |
| `found`      | The new URL, the target of a temporary redirect                                    |

A redirect without a `moved` or a `found` key returns an error with the code `JA001`.

---

## Create the rule

The instance runs only when a Rules Engine rule calls it. The rule below matches the requests to one domain. To create the rule:

1. **Open the Rules Engine tab**

   In **Applications**, select your application, then select the **Rules Engine** tab.

2. **Select + Rule**

3. **Name the rule**

   In **Name**, enter a name for the rule. For example: `Run Massive Redirect on xpto.com`. **Description** is optional.

4. **Select the phase**

   In the **Phase** section, select *Request Phase*.

5. **Set the criterion**

   In the **Criteria** section, set the variable to `${domain}` and the operator to *is equal*, then enter your domain as the argument. For example: `xpto.com`.

6. **Add the Run Function behavior**

   In the **Behaviors** section, select *Run Function*, then select the instance you created by its name.

7. **Select Save**

The rule appears in the **Rules Engine** tab, under the request phase, and runs the Massive Redirect instance on the requests to your domain.

For every criterion and behavior a rule accepts, refer to [Rules Engine](/en/documentation/platform/applications/rules-engine/).

---

## Next steps

- [Marketplace integrations](/en/documentation/platform/marketplace/integrations.md): The integrations Marketplace offers, and the application or firewall each one runs on.
- [Rules Engine](/en/documentation/platform/applications/rules-engine.md): The criteria and behaviors a rule accepts, to choose the requests that are redirected.
- [Functions instances](/en/documentation/platform/applications/functions-instances.md): How an application holds and runs the instances of its functions.
- [Update an integration](/en/documentation/guides/application-development/integrations/update-an-integration.md): How to get the latest version of an installed integration, and what an update creates.
