No results found. Try again with different words?

Search must be at least 3 characters.

Standard server 404 page showing instead of custom 404 page

There are times when a specific page is not found. In such cases, we need to make sure that the 404.php appears before the user. This is a default function that WordPress does. WordPress looks for the 404.php page when it does not find the required page.

However, there are times when the server encounters such issues before WordPress notices. In such cases, you can still be sure that your server displays the 404.php template file by configuring your web server for custom 404 error handling.

In order to tell your web server to use the custom error files, you will have to edit the .htaccess file in the main directory (i.e. the place where your main index.php file resides) of your WordPress installation. If you do not have a .htaccess file or are not sure where to find it, you can refer to the article here.

To be sure that your server finds the 404 page, add the following line into your .htaccess file:

ErrorDocument 404 /index.php?error=404

The URL above /index.php is root-relative. This means that the forward slash begins with the root folder of your site. If WordPress is present in the subfolder or the subdirectory of your site’s root folder, named ‘wordpress’, the line you should add to your .htaccess file is:

ErrorDocument 404 /wordpress/index.php?error=404

WARNING: If you are using custom permalink, the trick above does not work, see this.

Wish to read a little more about this? Here is an article you can refer to.

Was this article helpful?
Did not find a solution? We are here to help you succeed.

Related Docs

Astra is Free. Now & Forever.

We believe creating beautiful websites should not be expensive. That's why Astra is free for everyone. Get started for free and extend with affordable packages.

REWIND

YEAR IN REVIEW

Download is Just A Click Away!

Enter your email address and be the first to learn about updates and new features.

Download Free Astra Theme - Modal Popup Form
Scroll to Top
Now choose your preferred
page builder addon
Choose your preferred page builder addon

Download is Just A Click Away!

Enter your email address and be the first to learn about updates and new features.

Download Free Astra Theme - Modal Popup Form