How to install the Massive Redirect integration through Azion Marketplace

Massive Redirect is a serverless integration available at Azion Marketplace. This type of integration is mainly used for handling a massive quantity of domain redirects, such as domain migrations.

This integration permits you to control this domain redirection directly at the network’s edge, centralizing the management of several settings in one location. It also enables you to operate a variety of situations, such as CMS or e-commerce platform migration, website upgrades, and many others. No matter how many pages you have, you can configure all your redirects with the Massive Redirect integration.


To use the Massive Redirect integration provided by Azion Marketplace, you have to:

  1. Access Real-Time Manager (RTM) > Marketplace.
  2. On the Marketplace homepage, select the integration’s card.
  3. Once the integration’s page opens, click the Get It Now button, at the bottom-right corner of the page.

You’ll see a message indicating that your integration was successfully installed.


Once you’ve gotten your integration on Marketplace, it’ll be available at your edge functions list. To use the integration, you’ll have to create a new edge application.

Setting up the Edge Firewall rule

Section titled Setting up the Edge Firewall rule

To configure your integration, proceed as follows:

  1. On the upper-left corner, select Products menu > Edge Application on the BUILD section.
  2. On the listing page of your edge applications, select the one you want to use with the integration.
  3. On the application page, on the Main Settings tab, locate the Edge Functions switch and turn it on.
  4. Click the Save button.

You’ll receive a successful message indicating you have updated your edge application.

To enable this function:

  1. Select the Functions tab on the top list.
  2. Click the Add Function button.
  3. Choose an easy to remember name for your function.
  4. On the function dropdown menu, select the Massive Redirect [Global] function.

This action will load the function, showing a form with the function source code and, just above it, two tabs: Code and Args. By clicking on the Code tab you’ll be able to navigate through the code, but won’t be able to change it. The configuration of your Massive Redirect function will be made on the Args tab.

Click on the Args tab to open the form with the JSON Args where you’ll add the parameters to execute your application.

The Args tab will show a JSON file like the one below:

[
{
"from": "http://www.azion.com.br",
"found": "http://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":"http://www.azion.com.br/doc/%3$/%1$/%2$/"
}
]

Where:

  1. from: this is where you’ll pass the previous URL, the one you want to redirect to a new one.
  2. moved: this is where you’ll pass the new URL, the one you want to be the target of your redirect rule. This URL will be used as a permanent redirect to the previous URL.
  3. from_regex: this option permits you to pass multiple redirections in one command, passing more than one address in one line.
  4. found: this is the same as moved, but in this case you have a temporary redirect to a URL.

Configuring a rule on Rules Engine

Section titled Configuring a rule on Rules Engine

Still in the Edge Application page, in the Rules Engine tab, you have to configure the rules you want (criteria and behavior) to apply to run your function.

To do this, select the Rules Engine tab and proceed as follow:

  1. Add a new rule by clicking on the New Rule button and then selecting the Request Phase.
  2. Set a criteria for checking your domain. You’ll have something like if: ${domain} is equal xpto.com.
  3. On the behavior section, on Then, select Run a Function from the dropdown menu and then select the Massive Redirect option according to the name you gave it.
  4. Click the Save button on the lower-right corner.

To get more information and detailed reference, you can read the Configuring the Massive Redirect function for Domain Migration documentation.


Contributors