URL Redirects

Redirect Spreadsheets

Steps to take when a Jira issue includes a spreadsheet containing url redirects.

  1. Save the contents of the spreadsheet as a .csv file locally. Note: if the first row contains column header names, it will need to be removed or an error will occur when running rule generator app in a later step.

  2. Use the IRV redirect rule generator console application that’s in SVN located here:

    1. https://svn.interacttools.com:4443/svn/Interact/redirect_rule_generator/trunk

    2. After building the application in VS, the path to the binary should be C:\builds\dev\redirect_rule_generator\bin\Debug\Interact.RedirectRuleGenerator.exe

  3. Running the binary will open a command prompt that will ask you to enter the path to the CSV file that was created in step 1 above.

    1. Eg. C:\tmp\redirects\AirstreamSouthCarolina-Redirects.csv

  4. After entering the CSV file path and pressing Enter, you’ll be prompted to enter the name of the file to save the output redirect rules. Using the up arrow on your keyboard will display the path just entered, you can then just modify the end of the path from .csv to .txt and press enter.

  5. This will save the redirect rules in the proper format needed by nginx in the TXT file from the previous step. You’ll then see a message saying the redirect rules were saved along with the path to the file. Note: If there were any duplicate urls found, they will be listed on the screen along with url that was chosen.

  6. Ensure you have the latest version of the redirectMaps.conf file from svn located here:

    1. https://svn.interacttools.com:4443/svn/Interact/traffic_server/trunk/include/rebraco/live/redirectMaps.conf

  7. Open the TXT file created in step 5 in a text editor, then copy the contents of the file and paste them at the end of the redirectMaps.conf file, right before the closing brace and save the file.

  8. Commit the updated redirectMaps.conf file to svn, including the Jira issue ID# in the commit message as usual so it gets added to the work log.

  9. Within a minute or so, a job should be kicked off in Jenkins in the Live > live_redirect_maps pipeline. Ensure the Jenkins job completes successfully by reviewing the Console Output, you should see lines that says syntax is ok and test is successful. If the Jenkins job failed, take note of the errors in the console and review and update/fix the redirectMaps.conf file on your local machine and commit it to svn, again checking the Jenkins job output to ensure it was successful.

Note: The redirect rule generator console application contains logic that Html/Url encodes characters in the Urls. It also has logic that attempts to match any wildcard redirects in the Legacy Platform Redirects section (see below) and removes them. In order for a page specific redirect to be considered a match to a legacy platform redirect, both the source url and destination url must match.

iCommand Center Redirects

URL redirects can also be configured using iCC from the Websites > Url Redirects menu item. This page allows you manually add redirects, one at a time. Select the domain, if the account has more than one domain, then click on the Add Redirect button and enter the Redirect From and Redirect To locations. Once all of the redirects have been added click the Save button. The redirects listed on this page are pulled from the redirectMaps.conf file. Note: if an account has a large number of redirects this page may not load/save, in which case adding them using the spreadsheet method above may be required.

Legacy Platform Redirects

Inside the redirectMaps.conf file there’s a section for wildcard legacy platform redirects called LegacyPlatformRedirectsMap. It contains wildcard redirects which match certain patterns for other platforms, such as Dealer Spike. As we come across patterns for other legacy platforms, they should be added here.

The wildcard redirects are used in order to limit the number of page specific redirects. They also act as catchall redirects in case page specific redirects were missed.