404 Errors

Section 2 of the .htaccess file handles 404 errors.

If a URL is requested that does not resolve, ProcessWire will intervene and take care of displaying it's own 404 error page.

While this is beneficial and allows site administrators to use dynamic content on the 404 page, this could become a large problem on sites with excessive 404 errors. Therefore, it is recommended that 404 requests be optimized by using a static HTML page which the web server can delivery much more efficiently.

Step 1: Change File Name

Modify this line:
ErrorDocument 404 /index.php

To be this:
ErrorDocument 404 /404.html

Step 2: Create /404.html

Create a file called 404.html in the root directory of the ProcessWire installation. The contents of this file can be as simple or elaborate in stating a 404 error occurred.

==> 11/12/2021 -- doesn't work!


Previous Next

Episode #
2 of 7
Course
.htaccess File

ProCache: v405 Render date: 2025-12-06 04:51:29 Page render time: 0.0873s Total w/ProCache: 0.0876s