portal redirection
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2025 02:53 AM
HI Team ,
we configured custom URL but for some reason custom url is redirecting all users to native view.
We dont have much time to fix this, so as a quick fix we want to modify SPentry page script include to redirect all users redirected to native view through idp to be redirected back to custom url (custom portal).
how to get this ?
I tried to modify line 22 on spentry page script include.
var customURL = "www.customurl.com";
this.portal=customURL;
but this is not redirecting users from native view to custom url.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2025 03:00 AM
Hello @rambo1 ,
There is a oob script include which handles where to redirect the name of the script include is "SPEntryPage".
Note :This is a high risk script please amnd it and do through testing sample script is below:
var SPEntryPage = Class.create();
SPEntryPage.prototype = {
initialize: function() {
this.portal = '/custom_portal'; // Set your custom portal URL here
},
getFirstPageURL: function() {
var session = gs.getSession();
var redirectURL = session.getProperty('login_redirect');
// Redirect all users to the custom portal
if (!redirectURL) {
session.putProperty('login_redirect', this.portal);
return this.portal;
}
return redirectURL;
}
};
i would suggest before doing this change try to find out the root cause but for time being or so the provided solution is a workaround.
Please mark it as helpful/correct if this helps you.,
Regards,
Debasis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2025 03:01 AM
@rambo1 Where did you configured the custom url?
Modifying in the SPEntryPage script incude wont redirect you from native view to portal view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2025 03:08 AM
this article explains it well
6 ways to set up your Service Portal for redirection SUCCESS!
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2025 08:15 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader