I have a multisite network, and my theme has a custom 404.php
. On all the child sites this 404 handler is being correctly used, but on the primary site all 404s go back to the home page without touching my 404.php
at all.
And for once, this isn’t the fault of the Redirection plugin! The problem is still there when Redirection is turned off (network-wide and on the specific site).
The problem isn’t occurring on my local copy of the same site, but I can’t find any difference in the configuration or plugins that could be causing it.
If this is not occurring on your local installation: have you checked your webserver’s configuration? Since the locally it works and it seems to work for the 404’s of your subsites of your mainsite I would check this and make sure no plugins are activated during debugging this issue. If you use Apache with mod_rewrite you may want to check the logfiles (make sure it’s enabled). I hope this helps!
put this code into a file named 404.php :
replace xxxxxx.tld by your domain name
and it will work like a charm