HP Open Source Middleware Stacks Blueprints: LAMP Architecture on HP ProLiant BladeSystem Servers on SLES
3. Verify the custom text error message by opening a browser and entering the following
website:
http://<YOUR_WEB_SERVER_IP>/non-exist
The following message appears:
The page you requested does not exist! Plain text example
Customizing Local URL Redirect Responses
The following procedure is an example showing how to customize a local URL redirect error
message.
1. Edit the file /etc/apache2/errors.conf (or add it if it does not already exist) by entering
the following line:
ErrorDocument 404 "/missing.html"
2. Create an HTML file named /srv/www/htdocs/missing.html and add the following
content:
<HTML>
<HEAD>
</HEAD>
<BODY DIR="LTR">
<P ALIGN=CENTER STYLE="margin-bottom: 0cm">
<FONT FACE="Times New Roman, serif">
<FONT SIZE=6>The page you request does not exist!
Local redirects example</FONT></FONT></P>
</BODY>
</HTML>
3. Restart the Apache HTTP server for the changes to take effect.
4. Verify the custom local URL redirect message by opening a browser and entering the
following website:
http://<YOUR_WEB_SERVER_IP>/non-exist
The following message should display:
The page you request does not exist! Local redirects example
Customizing External URL Redirect Responses
The URL redirect feature allows you to trap a missing link error (404 error) in a browser on a
local server, display a message, and then redirect it to a URL on an external server. The following
steps illustrate how to customize external URL redirect responses. The process requires the use
of two servers; one that acts as local server, another that acts as an external server. Use the
following procedure to customize external URL redirect responses:
1. Edit the /etc/apache2/errors.conf file.
In the preceding file, change (or add, if it does not exist already) the following line:
ErrorDocument 404 http://<EXTERNAL_WEB_SERVER_IP>/missing.html
2. Create the file /srv/www/htdocs/missing.html.
Add the following lines to the preceding file:
<HTML>
<HEAD>
</HEAD>
<BODY DIR="LTR">
<P ALIGN=CENTER STYLE="margin-bottom: 0cm">
<FONT FACE="Times New Roman, serif">
<FONT SIZE=6>The page you request does not exist!
Local redirects example</FONT></FONT></P>
18