help-header

How to Use Variables for Advanced Redirect Settings in CDN Page Rules

 

Page Rules in the ArvanCloud user panel make it possible for users to temporarily or permanently transfer a specific URL’s traffic to another one. 

The setting is available on the ArvanCloud user panel > Content Delivery Network. 

To know more about it reading this article will be helpful: 

 

The following article will discuss the redirect setting by using variables. 

 

Advanced Redirect Setting

As mentioned in the Redirect Settings in Page Rules article, those features will redirect users to the intended pages. This process will not happen if the origin URL includes more than the main domain’s address.

For instance, once redirected, the traffic of this address:



will be transferred to the address below. 

 

Requests that point out to 



Will still be transferred to the address below. 

 

But it is better to transfer the traffic to this address: 



Use variables in page rule definitions to avoid such occurrences. To do so, follow the steps below.

  • Go to: ArvanCloud User Panel > Content Delivery Network > Page Rules.
  • Click on: Add New Rule.
  • In the pop-up window, enter the intended URL on the Address box. Click on (+) to add the new rule. 
  • Click on: Transfer. This will turn the box on. 
  • Choose one of these codes: 301, 302, 307 to determine the status.



On the address box, enter the address to which the traffic must be transferred. Please note that to use any variable, replace that part of the address with * sign. For instance:



 

Use a number and $ to determine the traffic’s destination address. 

 

An address can include more than one variable. 

When the settings are adjusted, click on Add New Rule to apply the new changes.