The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] Creating a network-wide 404 page (2 posts)

  1. Cyrolancer
    Posted 4 years ago #


    I want to create a network-wide 404 page, regardless of the template of the user's blog. All 404 errors should redirect to the custom 404 page.

    According to my research on WP Codex, I need to create a 404 page for all themes. In my network, there are a lot of themes and I am searching a way to redirect all 404 errors to my custom 404 page (ex: my-site.com/404.php) without touching any template file.

    How can it be possible?


  2. Cyrolancer
    Posted 4 years ago #

    Hello again,

    I think I have found a solution. I will explain step by step.

    1. I have created wp-content/mu-plugins/custom-functions.php

    2. I have added the following:

    function check404() {
            header('Location: /404.php');
    add_filter('404_template', check404);

    inside custom-functions.php file.

    3. I have created 404.php in the site root.

    That is so easy. Sorry for my "post pollution" in the forum.

Topic Closed

This topic has been closed to new replies.

About this Topic