Redirection from service portal

Rudranarayan P2
Tera Contributor

 

We are facing issue, with service portal redirection. 

The service portal is: https://support-dev.xy.com/csm

When customer tries to open this portal, they should be redirected to another page " https://www.ab.com/info/cust-supp.html ".

We have configured the ui script of the portal, as follows:

RudranarayanP2_0-1718213012746.png

csm portal page: 

RudranarayanP2_1-1718214077890.png

 

path to ui script:

service portal> theme>js include>ui script

 

This redirects to the new page properly but in the new page contains a link which again redirects to the URL "https://support.xy.com/csm?id=xxxxxxxxxxxxxxxxxxxx&sys_id=yyyyyyyyyyyyyyyyyyyyyyy".

 

The problem is when customer clicks on the link in the new page, the link does not open, rather it redirect backs to "https://www.ab.com/info/cust-supp.html ". because the redirection logic finds the CSM keyword and the redirection loop goes on.

Is there any way, we can break this redirection loop?

When the customer clicks on the link on the page " https://www.ab.com/info/cust-supp.html ", it should redirect to "https://support.xy.com/csm?id=xxxxxxxxxxxxxxxxxxxx&sys_id=yyyyyyyyyyyyyyyyyyyyyyyy" instead of redirecting back to https://www.ab.com/info/cust-supp.html ".

 

 

 

5 REPLIES 5

Rudranarayan P2
Tera Contributor

The below code worked for me:

 if (window.location.href.endsWith('csm') || window.location.href.endsWith('csm/')) {
                    var newUrl = https://www.ab.com/info/cust-supp.htmll";
                    window.location.replace(newUrl);
                }
 
@HrishabhKumar , thanks for your help.