How can i redirect to another URL if ESC is no longer the prefix

Abigail
Tera Expert

I changed the prefix from Employee Center (esc) to another one, but the thing here is that I need to redirect anyone that is using this prefix to the new one, I want to know a way to trigger this.
Is there a way I can do this?

Thanks.

1 ACCEPTED SOLUTION

sushantmalsure
Mega Sage
Mega Sage

Hi Abigail

You can create UI script for such redirections (System UI > UI script) and put following redirection script

addLoadEvent(redirect);
function redirect() {
if(document.URL.indexOf('/esc') != -1){
 window.location = '/NEW_ESC'; //here replace new_esc with your new portal prefix
}
}

sushantmalsure_0-1712215790331.png

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure

View solution in original post

8 REPLIES 8

sushantmalsure
Mega Sage
Mega Sage

Hi Abigail

You can create UI script for such redirections (System UI > UI script) and put following redirection script

addLoadEvent(redirect);
function redirect() {
if(document.URL.indexOf('/esc') != -1){
 window.location = '/NEW_ESC'; //here replace new_esc with your new portal prefix
}
}

sushantmalsure_0-1712215790331.png

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure

My question is if y type for example 
https://test.service-now.com/esc 

Could this redirect me to my new link, using UI Script?
https://test.service-now.com/newlink

 

Yes , have you tried the script I have provided ? you just need to change the 'NEW/ESC' to 'newlink'.

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure

Yes and it is not working.