« Rough edges, volume I   |   Main index   |  Rough edges, volume III »

Rough edges, volume II

March 2, 2004 | Comments (0)

After ALA posted the article called The Perfect 404 I thought it was a good idea to have a custom 404, page not found, myselves. My main target was to let it have the same look and feel of the rest of the site. The ALA article however showed some additional features that are of more help to the users. I did not imlement all features but I decided to implement the following features:

  • accept search engine parameters and put them as default in my search form.
  • have an OOPS when my site links to wrong pages and have an email me button.
  • check the referer.

To assign the custom page in apache 2, its enough to add/change the line:

ErrorDocument 404 /error/page-404.html.

This assigned error 404 to the page “/error/page-404.html”. All you need to do thereafter is restart apache. My unix will accept kill -HUP `cat /var/run/httpd.pid` to restart the process.

Give it a try at: http://jancology.com/page/does/not/exist


Post a comment

Use the form below to add your relevant comments, suggestions. Be aware that I reserve the right to edit any raw language, abusive and/or inappropriate comments that's too far off topic or remove it all together.

Line breaks and paragraphs are inserted by default; the following html tags are allowed: a href, b, br/, p, strong, em, ul, li, and blockquote. It is Gravatar enabled!