I have a 404.php file on my website to take care of my file not found errors. The default procedure (if not specified otherwise) is to forward the user to my main page AND I also want to send a 410 status code so that search engines that are following an incorrect URL don't think I'm cheating and using multiple doorways to point to my main page.
The problem ist that even if I send a 410 status code before...
header ("HTTP/1.0 410 Gone");
...the status code will automatically change to 302 as soon as I forward to a different page (as specified in the PHP manual: http://www.php.net/manual/en/function.header.php
Does anybody know if there is a solution for this?