Skip to content

Nitrogen Shift

Refer this page to configure redirections in bulk on your site using CSV import.
Typical use-case is, you would want to redirect multiple URLs at once due to a catalog update, or based on SEO-team recommendations.

*Note: For demo purpose, we will be using www.nviztest.com domain as an example.

Prerequisite

  1. You must have a domain configured on Nitrogen.

Steps

  1. Click on Domains menu, then select Nitrogen Shift tab. Select appropriate domain from the domains dropdown. Step

  2. You will be taken to a screen to upload the redirections from a CSV file.

  3. Click on Download Template button if no redirection is set earlier. You will receive a CSV file with few redirections records as an example.
    If you have configured redirections, click on Download current configuration button.

  4. Set the data as per your need:

    1. Enabled: Provide TRUE if the redirections should be in active state, FALSE if it should be disabled.

    2. Source Url: It specifies the regex pattern for the request URL. It supports regex-groups as well.
      e.g. ^/pricing/(.+)

    3. Source Country: If the redirection should be matched based on requestor's country, provide a standard 2-digit country code (e.g. CA for Canada). You can use this Wikipedia link for reference. For all countries, put .*.

    4. Target Url: It specifies the regex pattern for the final request URL (along with the HTTP scheme and domain name) that will be redirected to. We can also use the regex groups matched in source pattern here.
      e.g. https://www.nviztest.com/plans/$1

    5. Status Code: Enter the status code for this redirection.
      e.g. 301 (Permanent redirection), 302 (Temporary redirection) etc.

      Step

  5. Save your changes to this file on your machine, and upload it by clicking on Choose File button.
    Step

  6. Click on Save button. The configured rules will be showed in Redirects list.
    Step

  7. If you wish to add/edit/delete any of the configured rules, download the existing file by clicking Download Current Configuration button. Edit it. Then, upload it by clicking Upload New Configuration button.
    You can delete all the current redirections set using Shift by clicking Delete Current Configuration button.

Notes

  1. To make any redirection case insensitive, add (?i) at the beginning of Source Url.
    e.g. (?i)^/pricing/(.+)$

  2. To make any redirection match within query-string, add \?.*contentToMatch.* at the end of Source Url before $.
    e.g. ^/blog/\?date=(.+)$ >> https://www.nviztest.com/blog/date/$1

  3. The Source Url regex applies to whole url along with querystring.
    However, if no match is found for the regex-group mentioned in Target Url ($1, $2 etc.), it will be populated as it is.
    To avoid this issue, you can add two Source Url rows for with and without querystring match, and provide Target Urls accordingly.
    e.g. ^/product/(\d+)/.*$ >> https://www.nviztest.com/p/$1
    e.g. ^/product/(\d+)/.*(\?.*)$ >> https://www.nviztest.com/p/$1$2

  4. The order of patterns is of utmost importance. The first matched rule gets applied. So, please manage it accordingly.

  5. Please purge the source-URL if it's cached. Else, response will be served from cache instead of getting redirected.

  6. The redirections set using Shift have less priority than the redirections set using Redirects screen. So, please manage them accordingly.

  7. Though Shift supports up-to 5000 redirections, please note that having these many redirections can have adverse effect on performance, as all the requests need to get checked against these many rules.

  8. These changes will only take effect when deployed. Saving them will only be saving them in draft. Please refer documentation about Deploy process for it.