Skip to main content
ExLibris
Ex Libris Knowledge Center

How to redirect old domain name full length URL (including view)?

  • Product: Primo

 

Question

How to redirect old domain name full length URL (including view)?

Answer

Inorder to redirect the FE url that starts with the old domain (https://Primo_Old_domain.com) to new domain (https://Primo_New_domain.com/primo-e...arch?vid=View2)

Primo Home > Advanced Configuration > All Mapping Tables
Sub System: FRONTEND
Table Name:  Front-End Redirect Definitions
with this table, DNS: Primo_Old_domain.com will be successfully redirected to https://Primo_New_domain.com/primo-e...arch?vid=View2

But it is not the same with the old domain name full length URL's (which includes view) and are not getting redirected to the new domain.

For Example: https://Primo_Old_domain.com/primo-e...arch?vid=View1 is bookmarked by a student and this link cannot be redirected to the new domain using the Front-End Redirect Definitions Mapping table.

In such a case, this old domain name full length URL (including view) can be redirected by using custom.JS file from the customer end.

Please add a condition to your Custom.JS file checking something like this: "if the url contains the old domain name --> then --> window.location.replace("redirection link");"
For example: Check this JS script matching this requirement. Change it according to your requirement.
if(window.location.href.indexOf("Primo_Old_domain.com") > -1) {
window.location.replace("/primo-explore/search?sortby=rank&vid=UCL_VU2&lang=en_US");
} //This is just an example (may be not the exact working script). You need to script it accordingly.

Unfortunately providing CSS and or JS/AngularJS code for Primo New UI customization is out of support's scope.

 

 


  • Article last edited: 06-Jun-2020