Table of Contents
Custom Error Pages on Apache
Error pages, such as “page not found 404” or “forbidden 403” can customized. A customized error page can direct users to browse your site elsewhere. You can also explain user how to report the problem to you instead of the administrator of the whole web server.
© 2005 Tero Karvinen www.iki.fi/karvinen
.htaccess settings
Create a .htaccess under your home directory (/home/username/) under your web directory (public_html):
# $HOME/public_html/.htaccess # Customized error pages - http://www.iki.fi/karvinen/error_pages.html ErrorDocument 404 http://example.com/~myname/error_404.html ErrorDocument 403 http://example.com/~myname/error_403.html ErrorDocument 500 http://example.com/~myname/error_500.html
where example.com is your server and myname is your username.
Create the Error Page
Create a normal, static html page that is shown in the address you chose in .htaccess. For example, “$HOME/public_html/error_404.html”.
Tero’s Error Pages
See also
-
Apache Software Foundation: Custom Error Responses
-
Apache Software Foundation: Apache Core Features: ErrorDocument