How to Create Custom 403 and 404 Pages in Drupal

This tutorial will show you how to create custom error pages for 403 (Access Denied) and also 404 (Not Found) errors.
Step #1. Create the new error pages
First, let’s create the content that we’ll use for the new error pages.
- For example, go to Add content > Basic page.
- Create your page as usual. In this example, I’m creating a 404 error page. You can also create a 403 error page.

- We need to find the paths of our new error pages. You can look in the URL bar of your browser to find the paths:

Step #2. Add the custom pages to the Configuration
- Go to Configuration > Site information:

- Enter your new paths into the 403 and 404 error page boxes.
- Click “Save configuration”.

Step #3. Test
Finally, test to make sure they work.
That’s all there is to it. Congrats! Drupal makes it easy to add the custom 403 and 404 pages.

Note of caution
Because this approach uses nodes (i.e. individual pieces of content), the 403 and 404 pages will show in search results. Also, anything that ranks pages based on popularity would likely display at least the 404 page.
If either of the above are concerns for your site, consider using the CustomError module instead.
The downside to this method is that by making it a node, it’ll show up using the basic search functions. That’s not always ideal. There’s a whole host of ways to resolve this, each with their own ups and downs.
Thanks Earl! I added a note of caution at the bottom of the post.
Creating a special content type for default pages is a solution to that, as you probably have more than these two which you do not want to appear in searches or in administrative views.
So you have them easily at hand and not cluttering with the other content. If you do not want to have these shown in searches, you can go to the search view, and exclude these content types.
Additionally, the advantage of a special content type for such pages is that you can exclude these from sitemaps, configure metatags so that they are not indexed, etc.
This is very dated now, but I made a blog post about using custom error module, which is much more flexible and as Earl says doesn’t make nodes. This is from 2008, so do bear with me…
[url=http://www.kinetasystems.com/blog/creating-custom-error-pages-in-drupal]http://www.kinetasystems.co…[/url]
Thanks Nik! I’ll try and do a step-by-step tutorial for the CustomError module tomorrow or next week.
Here it is 🙂
[url=https://www.ostraining.com/blog/drupal/custom-error-module/]https://www.ostraining.com/…[/url]
Thanks Nick! That is a nice feature, and I have used it, but if the Access Denied message is on , and it is triggered by an unauthorised user. You can’t do that. I really liked that String Override module to change the verbiage so something more friendly.
Great! I’m glad the String Override option works well for you, Douglas.
For anyone else interested in the same approach, here’s the tutorial:
[url=https://www.ostraining.com/blog/drupal/change-language-strings/]https://www.ostraining.com/…[/url]
Thanks Nick Can you help me memcache issue facing on my production site , I am not getting any help from anywhere . Issue is after updating data , old data show on site and it keeps fluctuating with new content