WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

closed as too localized by toscho Jul 12 '12 at 22:43

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

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!

share|improve this answer

put this code into a file named 404.php :

   header("Status: 301 Moved Permanently");

replace xxxxxx.tld by your domain name

and it will work like a charm

share|improve this answer
I wasn't trying to make the 404 redirect to home, I was trying to prevent it doing so. – Marcus Downing Jan 20 '12 at 15:16
then the problem must be inside your .htaccess file, have a look at it , if you won't understand the code paste it here – Sufiyan Ghori Jan 20 '12 at 17:16
@Xufyan: I'd add an exit; statement after the header calls. – Geert Apr 27 '12 at 9:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.