HP Open Source Middleware Stacks Blueprint: LAMP Architecture on HP ProLiant BladeSystem Servers on RHEL
2. Create an HTML file named /var/www/html/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/http/conf/httpd.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 /var/www/html/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>
</BODY>
</HTML>
3. Restart the Apache HTTP server for the changes to take effect.
4. Verify the custom external URL redirect message by opening a browser and entering the
following website:
http://<YOUR_WEB_SERVER_IP>/non-exist
The following message appears:
The page you request does not exist! External redirects example
Using Per-User Web Directories
Using the UserDir function, each user is allowed to have a personal website in their home directory
on servers that have multiple users. Visiting a URL with its name in the form
http://example.com/~username displays the contents of the home directory of the user.
Installing, Configuring, and Managing LAMP Middleware Stack Components 17