One of the things you can do with Drupal is customize the "Error 403 Access Denied" and "Error 404 Page Not Found" pages. Drupal gives an option under Admin->Site Configuration->Error Reporting to redirect both of those to a custom URL.
My first try at updating the very spartan default error page was to create a node. I thought this would be be the easiest way because of course, that is what Drupal is good at doing. It would also maintain the theme of the site, and I could drop on blocks or whatever I wanted to in it easily. I drafted up a nifty "Page Not Found" node, aliased it to 404 and set it up to catch the redirect. One minor thing that I had to do was create a new content type. All my content requires categorization, and I didn't want those error pages showing up in category lists (taxonomy). So I created a new type that did not require a tag.
So that is one way to go. But I found the biggest drawback to this method was that since these error pages were still nodes, they would get tracked in my statistics. For example, most popular content listing would show my Page Not Found as my most popular content. Ugh. That does not make my site look to good to the casual user.
My second attempt was to create a static page and just place it in the root of my Drupal directory and redirect to that. That had the unpleasant effectw of 1) being very ugly, and 2) I suck at writing a decent HTML page from scratch. So this was pretty much a bust.
Of course, as always happens, my last course of action was to do what I should have thought of first. I consulted drupal.org, and lo and behold, there is a CustomError module available. Just a painless install, and it creates a couple of pages for 404 and 403 errors that are not nodes, so don't get tracked in statistics.
The only thing I did not like was the fact that the pages dropped off my sidebars. This made them look inconsistent with the rest of the site, and also had no easy way to navigate since the menu got dropped. After I did a little reading, I found out that doing this was intentional in version 5.0 of Drupal. The reason behind it was to reduce server load to render error pages.
On a small site like mine, that is not a concern. So looking around a bit more, I found a snippet to restore the sidebars and blocks:
<?php
function YOURTHEME_page($content, $show_blocks = TRUE) {
// Set additional conditions to change $show_blocks if you want here..
// The following will always set $show_blocks to TRUE.
$show_blocks = $show_blocks ? $show_blocks : TRUE;
// phptemplate_page is what gets called usually but the
// theme function allows us to override it with the themes' name.
// We're calling it directly here so we don't have to copy tons of code.
return phptemplate_page($content, $show_blocks);
}
?>
The above snippet goes in your template.php file. You need to change YOURTHEME to the name of the theme. Pop that in there, and voila, sidebars are restored. What this does is override the setting that caused them to disappear in the first place and you do not need to modify the drupal core module at all.