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¶
- You must have a domain configured on Nitrogen.
Steps¶
-
Click on
Domains
menu, then selectNitrogen Shift
tab. Select appropriate domain from the domains dropdown. -
You will be taken to a screen to upload the redirections from a CSV file.
-
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 onDownload current configuration
button. -
Set the data as per your need:
-
Enabled
: ProvideTRUE
if the redirections should be in active state,FALSE
if it should be disabled. -
Source Url
: It specifies the regex pattern for the request URL. It supports regex-groups as well. e.g.^/pricing/(.+)
-
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. Forall countries
, put.*
. -
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
-
Status Code
: Enter the status code for this redirection. e.g. 301 (Permanent redirection), 302 (Temporary redirection) etc.
-
-
Save your changes to this file on your machine, and upload it by clicking on
Choose File
button. -
Click on
Save
button. The configured rules will be showed inRedirects
list. -
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 clickingUpload New Configuration
button. You can delete all the current redirections set using Shift by clickingDelete Current Configuration
button.
Notes¶
-
To make any redirection case insensitive, add
(?i)
at the beginning of Source Url. e.g.(?i)^/pricing/(.+)$
-
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
-
The
Source Url
regex applies to whole url along with querystring. However, if no match is found for the regex-group mentioned inTarget Url
($1, $2 etc.), it will be populated as it is. To avoid this issue, you can add twoSource Url
rows for with and without querystring match, and provideTarget Urls
accordingly. e.g.^/product/(\d+)/.*$
>>https://www.nviztest.com/p/$1
e.g.^/product/(\d+)/.*(\?.*)$
>>https://www.nviztest.com/p/$1$2
-
The order of patterns is of utmost importance. The first matched rule gets applied. So, please manage it accordingly.
-
Please purge the source-URL if it's cached. Else, response will be served from cache instead of getting redirected.
-
The redirections set using
Shift
have less priority than the redirections set using Redirects screen. So, please manage them accordingly. -
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.
-
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.