how to avoid home.do( OR redirect to service portal) for end users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2018 01:37 PM
Hello community,
We've Service portal enabled where ideally users with no role can use to submit tickets. the redirection is working good. When i'm impersonating user with no role it is taking me to Portal.
however, When these users use home.do link it is taking to home.do self service page. This is not anyone expect, can we redirect users to portal instead when they specifically use home.do?
Thanks,
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2018 11:32 PM
Hello Nadon
Create a UI script:
1. Global: true
2. Script:
function portal_redirect()
{
var location = window.top.location.toString();
if(location.indexOf("home.do") >= 0)
{
window.top.location = "/sp";
}
}
portal_redirect();
Thanks
Abhijeet Upadhyay

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 10:06 AM
I found a bug with this UI Script in my instance, if the user attempts to go to: [https://<instance_name>.service-now.com/catalog_home.do?sysparm_view=catalog_default] or any other page that contains home.do, this script will redirect them to the landing page.
I fixed this by changing the if statement to:
if (location.endsWith("/home.do")) {
window.top.location = "/now/nav/ui/home";
}
I hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2018 11:02 AM
Great Abhijeet Upadhyay that worked like charm!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2018 11:10 AM
I've to take my response back, its causing inaccurate results, as default ITIL home page as home.do It's blocking every navigation from homepage, thank it did not did this in production