Drupal has some very good modules to deal with the 403 - 404 error pages. This article is about how to use Drupal modules to customize 403 and 404 pages.

Error page does not have to look plain and aweful

Why should we bother? Among pages of a website, the 403 (access denied) and 404 (page not found) error page seems to have least attention. However, it comes a little bit annoying for users to see an unwelcome page. I found frustrating when doing google for some keywords, clicked to a link but ended up with a page not found. Some times it's caused by system changes or article archiving. But for any reason, this could cause users to leave the site immediately.

Here are some solutions which Drupal provides for web administrators:

1. Redirect your error page

The simplest thing is to redirect all 403 and 404 error page to different pages of your website which contains more useful content.

This link /admin/settings/error-reporting is where we can set URL for each 403 and 404 page.

2. Search404 module

Search404 performs a search on keywords in the URL, for example, if a user goes to http: //example.com/does/not/exist, this module will do a search for "does not exist".

I have tried this module but opt it out. Many of my dead link is like /node/xxxx, so performing search for those keywords are useless.

3. Make your own custom error page

Important update !!!: since Drupal 7, custom error page is supported by Drupal core. You can find it under Admin - Configuration - Site information. Please see my detail guide.

Drupal 7 error handling

For Drupal 6, the CustomError module provides many handy options, you can change the page title and make a HTML custom page for error notification.

After installing this module, first you go to Error report section and change the 403 and 404 URLs to customerror/403, customerror/404 respectively.

Then you can go to /admin/settings/customerror to make your own HTML error page. Some thing funny could relax users and we can provide more useful information of the site.

Drupal 403 404 custom pages

Symphony Themes 404 Page

If you want more advanced options, CustomError allows you to execute code within the error page. Follow this link to Nik's blog, he has very nice pieces of code to provide different messages to different type of users (visitors or authenticated users).

4. Fast 404

One possible strategy to deal with 403 and 404 errors is delivering a message as quick as we can to save resources for other customers. It is particularly useful for high traffic website with limited resources (shared hostings, VPS ...).

Please read my other article on How Fast 404 saves our Drupal 7 site 25% of RAM.

Conclusion

I faced this issue when customizing URLs for better reading and leave many links to death. The problem is I have placed those URLs in blogs, forums or somewhere else. Many people following them could suffer from 404 error page.

Thanks to CustomError, I have a nice page that does not push my visitors away.

If you find this article is useful, please subscribe to our newsletter. More interesting posts will be sent to you periodically.

By Thanh Le

Comments

I am here in D 6 and follow

I am here in D 6 and follow the 3 steps above, but my 404 page and still see the old 404 error page! Even to my left and right blocks disappear!
Am I missing something?
Your help is appreciated
I am willing to keep the solution to install another module, if only you can specify in mysite.com / admin / settings / error reports!
Thank you.
bookshelves

Why should we bother? Among

Why should we bother? Among the pages of a site, think on page 403 (access denied) and 404 (page not found) to get the least attention. But there comes a little inconvenient for users to see a side unpleasant.

This guy making super fint on

This guy making super fint on his bicycle or he is falling?

Subscribe to our mailing list

* indicates required