Redirecting a user to custom 404 error page

Problem Statement

Whenever a user enters a wrong URL, he is redirected to portal site homepage. In such cases, how to redirect a user to a customized and informative error page when something written after /wps/portal/ doesn't actually exists in portal.

For Example, If the user use the below URL, he will be redirected to portal homepage.

"http://localhost:10039/wps/portal/invalidpagelocation" where "invalidpagelocation" is the friendly URL of the page.


Solution

When you try to access invalid URL, the default behaviour redirects the user to home page. Now in order
for Portal server to throw 404 error, make the following configuration changes.

Login to WAS console and set these three configuration settings to the Resource environment provider > WP ConfigService

friendly.pathinfo.invalid = true
state.decoding.fallback = false
wps.mappingurl.invalid = true

Follow the steps as mentioned in http://www-01.ibm.com/support/docview.wss?uid=swg21411195 with the following modifications.

Apart from web.xml file, also modify web_merged.xml.

Also see

Can users be redirected to a specific home page instead of the login page when missing a location?

No comments:

Post a Comment