When an HTML error code is returned as a response to a URL request (for example, 404 Not Found), eXo Platform redirects users to a default error page where the error code is displayed together with an explanatory message. To replace the default error page with a customized one, the configuration explained below needs to be performed.
Create the actual error pages and place them in the
For each error code that shall have its custom error page, add the
element to the
file. This element
specifies what page is displayed when the particular error code is returned.
The sample code below ensures that the
page is displayed when the 404 error
code is returned.
Specify the error page locations as static resources in the
file. The code sample
below demonstrates this configuration for the
Without this configuration, the portal tries to resolve
as a name of a portal or
another resource. This results in unwanted redirection to
It is therefore
necessary to configure the error page locations as static resources.
When all the previous steps are performed, users are redirected to the specified custom error pages when the respective error codes are returned as a response to a URL request.