How to create redirection rules?

Of course, creating and managing redirection rules is the way to go in order to benefit from

Redirection rules can contain much complexity, as they can express several redirections at once, based on patterns. For example, a redirection can be used to redirect all the urls of the form /shop/products.php?id=<INTEGER> to /shop/clothes/product-<INTEGER>.html, with the status code of your choice. Of course, the rules can embed much more complexity based on the requirements you choose to apply.

Under the hood, we use regular expressions to match incoming URLs, but you won't have to write manually these regular expressions. You can instead use our graphical expressions builder, which allow to express complex requirements in a simple way.

Redirection rules creation steps

Creating redirection rules is rather easy and straightforward:

  1. project dashboardhead to the dashboard of your project
  2. Rules menuhit the "Rules" menu link
  3. Button to add a new ruleclick the "Add a new rule" link, on the upper right corner of the page
  4. Rule creation formfill the rules creation form. You may use the "Add marker" button to insert markers, which are re-usable items that we will collect from the incoming URL. For example, if the url to match is of the form /shop/products/<ID> with <ID> an integer, you can type /shop/products/and the hit the "Add marker" button, and insert an "integer" marker (name it as you like). In the "target URL" field, you can then use this newly created marker!
  5. click the "Test impact" button
  6. Impact resultsCheck that the new rule has the expected impact on the current traffic. The "rule impact" is computed on the logged traffic, which means that, if your agent has only been recently installed, you could not have the full picture of the rule impacts.
  7. If everything looks right, click the "Add a new rule" button. The rule will be saved, but won't be immediately applied to your production: your first have to "publish" the changes.

Changes publication and history

One you have made several changes to your redirections ruleset, you may want to apply these changes on your instances.

  1. Ruleset changes reviewlook at the top of the screen: the orange bar shows that there are unpublished changes in your draft ruleset.
  2. Ruleset changes publicationonce you have reviewed the changed, you may publish them using the "Publish changes" button. This will ask for an optional publication comment, the right place to explain what you just did for later understanding.
  3. After a few seconds, depending on your plan, the new rules should be applied to your instances. Head to the project's dashboard, you should be able to see which instances are up-to-date.

When are my rules applied ?

Your newly created redirection rules should be applied on your website after a short delay, depending on the plan that you are using - this usually ranges from 10 seconds to 10 minutes. You may want to check which agents are up-to-date on your project's dashboard, which lists running instances, when they have been updated, and how many rules they are using.

Can't find your answer?