Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

2 Answers 2

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 :

<?php
   header("Status: 301 Moved Permanently");
   header("Location:http://www.xxxxxx.tld");
?>

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.