This page demonstrates how the BCN error page works, showing the PHP source code so you can copy any ideas you like for your own pages. The main feature of this page is that it shows the user the referrer URL (HTTP_REFERER header) and encourages them to help fix the upstream problems. To see this feature in action, 1) Cut and paste this URL into your browser http://bcn.boulder.co.us/error404test.html 2) Then click on the bad link it referrs to. Note the last bullet item in the resulting error page: "Fix the page that's causing the problem". Compare the result with a URL you just type in at random, like http://bcn.boulder.co.us/wfo235f which is not referred to by a hot link on a web page. That section of the error page will be left out if there is no HTTP_REFERER. We also point to a possible Google cache of the page. For more on PHP see http://php.net/ We use Apache - http://apache.org If you also use Apache, you can usually enable your own error page, by putting a ".htaccess" file in a directory. It will apply to all URLs that refer to that directory and all subdirectories. The file should contain something this or a variant: ErrorDocument 404 /error404.php Hope this helps, Neal McBurnett http://bcn.boulder.co.us/~neal/ Signed and/or sealed mail encouraged. GPG/PGP Keyid: 2C9EBA60 -------------------
Oops! Page Not Found:
="http://$host$origurl"?>
Thanks for visiting the Boulder Community Network, maintained with the help of hundreds of volunteers!
We're sorry we don't see the page you're looking for. It might have been removed, had its name changed, or be temporarily unavailable.
Please try the following:
Click on this link for the "> Google Cache of the page you were looking for which may temporarily provide a snapshot of the page, if it did once exist and get cached by Google.
The Wayback Machine offers a similar service, in that you can enter a URL and view a page or site 'as it once was'.
http://bcn.boulder.co.us/somecenter/page.htmlErase everything after the last slash in the address, so you're left with:
http://bcn.boulder.co.us/somecenter/You may get a page or a directory listing; in either case, you may be able to find what you're looking for. If you don't come up with anything at this address, try backing up again. Eventually you'll come to the BCN home page which can also help:
http://bcn.boulder.co.us/
=$referrer?>
that referred you here
should be updated so it no longer points to this page.
Consider writing to the webmaster of the referring page, or use
their form for reporting broken links. This might not help you find
the page you're looking for, but at least you may be saving other
people the trouble. Most search engines and directories have an
easy way to report broken links.
How did we generate this error page?
See http://bcn.boulder.co.us/error404.txt for the Apache and PHP code used to generate this error page, and more information.
Thanks to Madhu Menon (themadman) of evolt.org and the 404 Research Lab for great tips on error pages.
Hope this helps!