1 of 20
2 of 20
3 of 20
4 of 20
5 of 20
6 of 20
7 of 20
8 of 20
9 of 20
10 of 20
11 of 20
12 of 20
13 of 20
14 of 20
15 of 20
16 of 20
17 of 20
18 of 20
19 of 20
20 of 20

doc

How to install the Massive Redirect solution through Azion Marketplace

Overview

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

This solution 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 other. No matter how many pages you have, you can configure all your redirects with the Massive Redirect solution.

Important: you have to observe the limit of 300kb for the JSON file.


  1. Getting the solution
  2. Using the solution
  3. Configuring the solution
  4. Instantiating the solution
  5. Configuring a rule on Rules Engine

1. Getting the solution

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

  1. Log in to your Real-Time Manager (RTM) account.
  2. On the upper-left corner of the page, select Products menu > Marketplace.
  3. Select the search box and type “massive” or browse through the cards to find the Massive Redirect solution.
  4. Once you’ve found the Massive Redirect card, select it to go the solution page.
  5. On the solution page, look for the Subscribe for section on the bottom-right corner.
  6. Click the Get It Now button.

You’ll see a message indicating that your solution was successfully installed and is ready to use.

2. Using the solution

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

To create an edge application you have three options:

  • By visiting the documentation on getting started.
  • Through RTM, on the upper-left corner of the page, select Products menu > Edge Application and follow the instructions.
  • Using an already existing edge application.

3. Configuring the solution

To configure your solution, 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 Fauna solution.
  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.

4. Instantiating the solution

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.

Note that you have several sections on the Args tab. This happens because you can configure several different redirections at the same time.

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.

Important: if you forgot to pass either the moved and/or found keys in the Args tab you’ll receive an error message with the code JA001.

5. 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.


Didn’t find what you were looking for? Open a support ticket.