- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2024 12:23 AM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2024 12:30 AM
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
}
}
Regards,Sushant Malsure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2024 02:07 AM
share your script screenshot and test case you are trying with to help you better.
Regards,Sushant Malsure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2024 12:54 AM
Hi @Abigail ,
Below link will help you on this.
Redirect pages (e.g. links, bookmarks) to an other Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2024 01:07 AM
Hello @Onkar Pandav
I already used that link, the problem is that I don't know how to redirect when the ESC prefix is no longer used on the portal prefix.
So I want to know if there is a way to redirect without a portal or page, only if I type the URL with the esc, will this redirect me to the new one. I was wondering if there was a way to trigger this, only with the URL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2024 03:36 AM
Try below code:
var currentURL = window.location.href;
var newURL = currentURL.replace("x", "y");
window.location.href = newURL;