Skip to main content link. Accesskey S
  • Log In
  • Help
  • IBM Logo
  • WebSphere Portal Family wiki
  • All Wikis
  • All Forums
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • IBM Redbooks
Community Articles Product Documentation Learning Center IBM Redbooks This category IBM Redbooks: Building a Sample Website Using IBM Web Content Manager 7.0 IBM Redbooks: Building and Implementing a Social Portal IBM Redbooks: Developing Exceptional Multi-Channel Web Experiences V7: IBM Web Content Manager Product Documentation V7: IBM WebSphere Portal Enable for z/OS Product Documentation V7: IBM WebSphere Portal Express Product Documentation V7: WebSphere Portal Product Documentation V8: IBM Web Content Manager Product Documentation V8: IBM WebSphere Portal Express Product Documentation V8: IBM WebSphere Portal Product Documentation (includes z/OS) Custom Search Scope...
Search
Community Articles > Resources for developers > Customizing error pages in IBM WebSphere Portal and IBM Web Content Manager applications in a multi-site environment
  • New Article
  • Share Show Menu▼
  • Subscribe Show Menu▼

About the Original Author

IBM contributorLeslie Gallo
Contribution Summary:
  • Articles authored: 30
  • Articles edited: 14
  • Comments Posted: 0

Recent articles by this author

Collecting performance measurements of your IBM WebSphere - Java Virtual Machine

This article discusses an example of creating a collection of IBM WebSphere Portal performance measurements, using the Administrator Thin Client to running a jython script for collecting the desired data.

Integrating IBM WebSphere Portal 7 with Microsoft SharePoint 2010

This article explains how to integrate the portal frameworks between IBM WebSphere Portal, which is based on the J2EE programming model, and Microsoft SharePoint, which is based on the .NET programming model.

IBM WebSphere Portal 7 customization scenario: Part 1, Customizing a menu portlet

During an IBM WebSphere Portal implementation, customization is typically required in a few areas. This article explains how to build a customized WebSphere Portal menu in a JSR portlet, using WebSphere Portal 7 APISPIs.

Increasing the Search Engine Optimization ranking for IBM Web Content Manager Web sites

Learn how how you can remove both the traditional 301 (0 302) redirect from a Web site root to an IBM Web Content Manager URL and the common path part from the URL, such as wcpwcmconnectlibraryName.

Performance management tools for IBM WebSphere Portal

This document details the tooling that was used during a recent performancerelated customer engagement. It describes the tools and how they were used to evaluate IBM WebSphere Portal 7 performance problem determination issues.

Community articleCustomizing error pages in IBM WebSphere Portal and IBM Web Content Manager applications in a multi-site environment

Added by IBM contributor Leslie Gallo | Edited by IBM contributor Leslie Gallo on February 14, 2012 | Version 7
  • Edit
  • More Actions Show Menu▼
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars
expanded Abstract
collapsed Abstract
This article shows how, when browsing a Web site, or following a link to a blog or following a mapped access to a resource that does not exist, you can create a customized courtesy page containing an informative error and proposing an alternative, instead of a page that provides only a useless message such as “Error 404: SRVE0190E: File not Found: /.......”
Tags:
ShowTable of Contents
HideTable of Contents
  • 1 Introduction
  • 2 Solution overview
    • 2.1 Our objectives
  • 3 Configuration steps
    • 3.1 Cluster environment 24x7
    • 3.2 Standalone environment
  • 4 Resources
  • 5 About the author

Introduction


When a user generates a GET request to an incorrect URL, such as http://mysite.com/wps/myportals, instead of going to that address, the application server typically responds with a generic message such as:
“Error 404: SRVE0190E: File not Found: /myportals”
Incorrect URL resources are handled and processed within the IBM® WebSphere® Application (WAS) security layer and, in order to allow a custom error page to display, you must modify the IBM WebSphere Portal configuration.

Figure 1 depicts a logical schema of the error-handling configuration in which WebSphere Portal installed. In this scenario there are multiple Web sites and intranets to customize the error page for your Web site. This article is a simplified guide to customize these error pages.

Figure 1. Error-handling process

Solution overview


We have two possible scenarios, a cluster environment and a standalone environment, and our solution is tested and verified in both. The scenario in which we do the configuration is shown in figure 2.

Figure 2. Configuration scenario

Our objectives


If we request a page from a particular brand site and there is an error event, we receive an error page with the same brand. When browsing a Web site, or following a link to a blog or a mapped access to a resource that does not exist, we want to receive a courtesy page containing an informative error and proposing an alternative, ideally in keeping with the layout of the site itself.

In other words, we don't want a page that provides only a useless message such as:
Error 404: SRVE0190E: File not Found: /.......
Instead, we want to receive a courtesy page like that shown in figure 3.

Figure 3. Example courtesy error page

Configuration steps


Cluster environment 24x7


The applications involved are wps.ear and wcm.ear, and the following steps reflect making the application with the goal of customizing error conditions using a specific page. To do this we must edit the web.xml of the application:

Prepare your HTTP Server
1. Create a custom page for every Web site to display to the user, for example, create the directory "ep" (Error Page root) under your DocumentRoot, such as <IHS InstallPath>/www/<YourSiteDocumentRoot>/ep/, as follows:
e404.html
e409.html
e500.html
2. Optional: In accordance with the rewrite rule configuration, insert the following in your definition:

RewriteEngine on
# RewriteLog /logs/rewrite.log" #(uncomment if you want the trace log)
# RewriteLogLevel 3 #(uncomment if you want the trace log)
RewriteCond %{REQUEST_URI} ^/wps.*$
RewriteCond %{REQUEST_URI} !./connect.*$
RewriteCond %{REQUEST_URI} !./myconnect.*$
RewriteRule ^/(.*) /ep/re404.html [PT,NC,L]

where the re404.html page is similar to:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=/ep/e404.html"> <title>Not Found</title>
</head>
<body>
</body>
</html>

This page is necessary when the broken link is in part of the URL; for example, when you call http://<fqdn>/wps/wcm/brokenConnection/..., the system shows you the custom page but does not change the URL in the browser. If the user sees the original request, then the URL rewrite is not necessary.

3. Restart the HTTP Server.

Customize the WebSphere Portal application
Now let's work in the Deployment Manager environment to customize the Portal application:

1. In the web.xml file deployed and used by WAS,
/profiles/<DMGRProfiles>/config/cells/applications/wps.ear/deployments/wps/ wps.war/WEB-INF/web.xml

find the following tag sequence:
</mime-mapping>
<resource-ref>
2. Edit this file, inserting between these lines the specification for error handling; for example:

<error-page>
     <error-code>404</error-code>
     <location>/ep/e404.html</location>
</error-page>

where the error code is “clear”, and the location indicates where the customized page is.
If this page is used only for redirection to the HTTP standard error page; then we would insert the following tag:

<error-page>
    <error-code>404</error-code>
    <location>/ep/e404.html</location>
</error-page>
<error-page>
    <error-code>500</error-code>
    <location>/ep/e500.html</location>
</error-page>
<error-page>
    <error-code>409</error-code>
    <location>/ep/e409.html</location>
</error-page>

3. Save the file.

Now we edit the same file in the wcm.ear, which is used when you synchronize the node:

1. In the web.xml that you find in
/profiles/<DMGRProfiles>/config/cells/applications/ wcm.ear/ilwwcm.war/ WEB-INF/web.xml

find the following tag sequence:
</mime-mapping>
<resource-ref>
2. Insert between these lines the following specification for error handling:

<error-page>
    <error-code>404</error-code>
    <location>/ep/e404.html</location>
</error-page>
<error-page>
    <error-code>500</error-code>
    <location>/ep/e500.html</location>
</error-page>
<error-page>
    <error-code>409</error-code>
    <location>/ep/e409.html</location>
</error-page>

3. Save the file, and update all the .ear files.

Customize WCM application
Now we work in the Deployment Manager environment for customizing the IBM Web Content Manager application:

1. In the web.xml that you find in
/wp-profiles/Dmgr01/config/cells/applications/wcm.ear/deployments/wcm/ilwwcm.war/WEB-INF/web.xml,

which is the web.xml file deployed and used by WAS, find the following tag sequence:
</mime-mapping>
<resource-ref>
2. Insert between these lines the specification for error handling, for example:

<error-page>
     <error-code>404</error-code>
     <location>/ep/e404.html</location>
</error-page>

where error code is “clear”, and location indicates where the customized page is. If this page is used only for redirection to the HTTP standard error page, we would insert the following tag:

<error-page>
    <error-code>404</error-code>
    <location>/ep/e404.html</location>
</error-page>
<error-page>
    <error-code>500</error-code>
    <location>/ep/e500.html</location>
</error-page>
<error-page>
    <error-code>409</error-code>
    <location>/ep/e409.html</location>
</error-page>

3. Save the file.

Now we edit the same file into the wcm.ear, which is used when you synchronize the node:

1. In the web.xml that you find in
/profiles/Dmgr01/config/cells/applications/ wcm.ear/ilwwcm.war/ WEB-INF/web.xml

find the following tag sequence:

</mime-mapping>
<resource-ref>
2. Insert between the lines the following specification for error handling:

<error-page>
    <error-code>404</error-code>
    <location>/ep/e404.html</location>
</error-page>
<error-page>
    <error-code>500</error-code>
    <location>/ep/e500.html</location>
</error-page>
<error-page>
    <error-code>409</error-code>
    <location>/ep/e409.html</location>
</error-page>

3. Save the file, and update all the .ear files.

Create redirection page
Now we insert the custom page in wps.war (the same we have now modified):

1. Create the directory /ep, and create the html page to redirect:
e404.html
e409.html
e500.html

for example, you can use the following .html code:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=/ep/e404.html"> <title>Not Found</title>
</head>
<body>
</body>
</html>
Note that you must use a relative URL to ensure that your request is redirected to your site independently of any FQDN you request.
2. Synchronize all Portal nodes and restart your Portal Server.

Standalone environment


The applications involved in this case are wps.ear and wcm.ear, and the following steps reflect making the application with the goal of customizing error conditions using a specific page. To do this, you must edit the web.xml of the application.

Prepare your HTTP Server
1. Create a custom page for every Web site to display to the user, for example, create the directory "ep" (Error Page root) under your DocumentRoot, such as /www//ep/ as follows:
e404.html
e409.html
e500.html
2. Optional: In accord with the rewrite rule configuration, insert the following in your definition:

RewriteEngine on
# RewriteLog /logs/rewrite.log" #(uncomment if you want the trace log)
# RewriteLogLevel 3 #(uncomment if you want the trace log)
RewriteCond %{REQUEST_URI} ^/wps.*$
RewriteCond %{REQUEST_URI} !./connect.*$
RewriteCond %{REQUEST_URI} !./myconnect.*$
RewriteRule ^/(.*) /ep/re404.html [PT,NC,L]

where the re404.html page is similar to:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=/ep/e404.html"> <title>Not Found</title>
</head>
<body>
</body>
</html>
This page is necessary when the broken link is in part of the URL; for example, when you call http:///wps/wcm/brokenConnection/..., the system shows you the custom page but does not change the URL in the browser. If the user sees the original request, then the URL rewrite is not necessary.
3. Restart the HTTP Server.

Customize the Portal application
1. In the web.xml in
/wp_profile/config/cells/applications/wps.ear/deployments/wps/wps.war/WEB-INF/web.xml

which is the web.xml file deployed and use by WAS, find the following tag sequence:
</mime-mapping>
<resource-ref>
2. Insert between the lines the specification for error handling; for example:

<error-page>
     <error-code>404</error-code>
     <location>/ep/e404.html</location>
</error-page>
where error code is “clear”, and the location indicates where the customized page is. If this page is used only for redirection to the HTTP standard error page, we insert the following tag:

<error-page>
    <error-code>404</error-code>
    <location>/ep/e404.html</location>
</error-page>
<error-page>
    <error-code>500</error-code>
    <location>/ep/e500.html</location>
</error-page>
<error-page>
    <error-code>409</error-code>
    <location>/ep/e409.html</location>
</error-page>

3. Save the file.

Now we edit the same file in the wcm.ear, which is used when you synchronize the node.

1. In the web.xml in
/wp_profile/config/cells/applications/wps.ear/wps.ear/wps.war/WEB-INF/web.xml
find the following tag sequence:
</mime-mapping>
<resource-ref>
2. Insert between the lines the following specification for error handling:

<error-page>
    <error-code>404</error-code>
    <location>/ep/e404.html</location>
</error-page>
<error-page>
    <error-code>500</error-code>
    <location>/ep/e500.html</location>
</error-page>
<error-page>
    <error-code>409</error-code>
    <location>/ep/e409.html</location>
</error-page>

3. Save the file, and update all .ear files.

4. Now we insert the custom page in wps.war (the same we have now modified):
create the directory /ep
create the .html page to redirect
e404.html
e409.html
e500.html
for example, you can use this .html code:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=/ep/e404.html"> <title>Not Found</title>
</head>
<body>
</body>
</html>
Note that you must use a relative URL to ensure that your request is redirected to your site independently of any FQDN you request.
5. Restart the Portal Server.

Customize the WCM Application
1. In the web.xml in
/wp_profile/config/cellapplications/wps.ear/deployments/wps/wps.war/WEB-INF/web.xml,
which is the web.xml file deployed and used by WAS, find the following tag sequence:
</mime-mapping>
<resource-ref>
2. Insert between the lines the specification for error handling, for example:

<error-page>
     <error-code>404</error-code>
     <location>/ep/e404.html</location>
</error-page>
where error code is “clear”, and location indicates where the customized page is. If this page is used only for redirection to the HTTP standard error page, we insert the following tag:

<error-page>
    <error-code>404</error-code>
    <location>/ep/e404.html</location>
</error-page>
<error-page>
    <error-code>500</error-code>
    <location>/ep/e500.html</location>
</error-page>
<error-page>
    <error-code>409</error-code>
    <location>/ep/e409.html</location>
</error-page>

3. Save the file.

Now we edit the same file in the wcm.ear, which is used when you synchronize the node:

1. In the web.xml in
/profiles/Dmgr01/config/cellsapplications/ wcm.ear/ilwwcm.war/ WEB-INF/web.xml,

find the following tag sequence:
</mime-mapping>
<resource-ref>
2. Insert between the lines the following specification for error handling:

<error-page>
    <error-code>404</error-code>
    <location>/ep/e404.html</location>
</error-page>
<error-page>
    <error-code>500</error-code>
    <location>/ep/e500.html</location>
</error-page>
<error-page>
    <error-code>409</error-code>
    <location>/ep/e409.html</location>
</error-page>

3. Save the file, and update all .ear files.

Create the redirection page
Now we insert the custom page in ilwwcm.war and in the deployed ilwwcm.war found in:
/wp_profile/installedAppwcm.ear/ilwwcm.war
1. Create the directory /ep, and create the .html page to redirect:
e404.html
e409.html
e500.html
for example, you can use the following .html code:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=/ep/e404.html"> <title>Not Found</title>
</head>
<body>
</body>
</html>
Note that you must use a relative URL to ensure that your request is redirected to your site independently of any FQDN you request.
3. Restart the Portal Server.

This configuration is verified and tested in WebSphere Portal server versions 6.1.5.x and 7.0.x.

Resources


WebSphere Portal Infocenter

IBM Http Server Forum

Apache Http Server Project

About the author



Andrea Fontana currently works as a System Architect, defining, organizing, and configuring complex IBM product-based solutions. In particular he works with WebSphere Portal and its collaborative environment including Domino 8.0.x, 8.5, IBM Connections 3.01, Lotus Quickr 8.0.x, and IBM Sametime, with respect to setting up SSO Kerberos integration solutions and configuring systems with a R-proxy solution with SSL integration. His past experience includes roles as an Application Developer, Database Administrator, and Project Manager in a wide variety of business applications. He graduated from the ITIS Zuccante C., Mestre (Venice), specializing in Industrial Electronics. You can reach Andrea at a.fontana@net2action.com.

  • Edit
  • More Actions Show Menu▼


expanded Attachments (0)
collapsed Attachments (0)
Edit the article to add or modify attachments.
expanded Versions (7)
collapsed Versions (7)
Version Comparison     
VersionDateChanged by              Summary of changes
This version (7)Feb 14, 2012 3:16:55 PMLeslie Gallo  IBM contributor
5Feb 14, 2012 3:03:17 PMLeslie Gallo  IBM contributor
4Feb 14, 2012 2:43:15 PMLeslie Gallo  IBM contributor
3Feb 14, 2012 2:39:07 PMLeslie Gallo  IBM contributor
2Feb 14, 2012 2:16:38 PMLeslie Gallo  IBM contributor
1Feb 14, 2012 2:11:42 PMLeslie Gallo  IBM contributor
1Feb 14, 2012 2:05:34 PMLeslie Gallo  IBM contributor
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedHelpAbout
  • IBM Collaboration Solutions wikis
  • IBM developerWorks
  • IBM Software support
  • Twitter LinkIBMSocialBizUX on Twitter
  • FacebookIBMSocialBizUX on Facebook
  • ForumsLotus product forums
  • BlogsIBM Social Business UX blog
  • Community LinkIBM Collaboration Solutions
  • Wiki Help
  • Forgot user name/password
  • Wiki design feedback
  • Content feedback
  • About the wiki
  • About IBM
  • Privacy
  • Accessibility
  • IBM Terms of use
  • Wiki terms of use