0
votes

I am having difficulties applying my custom 404 page in Drupal.

So first I wrote my own custom 404.html (outside Drupal, so it isn't part of Drupal nor of its database!) and uploaded it to my FTP server. When I browse to /admin/config/system/site-information and insert the path to this newly uploaded 404.html file it tells me that the file doesn't exist or that I don't have the permission to view it.

I think the problem is that my custom page isn't really part of Drupal because I uploaded and designed it myself, outside Drupal. But does anyone know how to fix this?

Thanks in advance!

3
I'm not entirely sure, but I think those Drupal settings just refer to a Drupal specific menu path. - mrlee

3 Answers

3
votes

Drupal expects node paths when you're setting error pages like that. If you don't want to use Drupal nodes, you'll need to specify your 404 page in an Apache config (.htaccess probably) using the ErrorDocument directive.

1
votes

Take a look at the CustomError module. This will allow you to use your HTML created error pages. From the project page:

This module allows the site admin to create custom error pages for 404 (not found), and 403 (access denied), without the need to create nodes for each of them.

Since the error pages are not real nodes, they do not belong a category term, they do not show in the search, and will not show up in node listings, or in Popular Content block.

0
votes

I agree with Karl that Drupal expects a node path, but not overriding Drupal paths with Apache .htaccess. Leave the .htaccess alone.

You should create a New Basic Page (leave blank) and html--node--(xxx).tpl.php file. html.tpl.php and Drupal 7 template

This allows you to develop a static 404 page with it's own HTML layout and content. You don't need a module to do this.

Very simple and direct. FTP this template file to the themes template folder. Set the 404 with the same node as the new page with the template in admin/config/system/site-information

<html>
<head>
<title>Page not found!</title>
</head>
<body>

File not found (404 error)
If you think what you're looking for should be here, please contact the site owner.

</body>
</html>