I was trying to check the validity of my HTML for my Vanilla site using W3C's HTML checker the other day when it came back with a 404. It showed a 404 on any page I tried in Vanilla. When looking at the site using a browser all the pages download fine. I decided to check the http headers in firefox using the Web Developer toolbar when I noticed that it said the following:
How can it show a 404 yet download correctly - I'm so confused!! I obviously need to get this fixed otherwise the site won't get indexed by search engines.
The Vanilla installation is sitting inside a Wordpress installation. I'm using friendly urls in Vanilla and pretty permalink structure in WP.
I'm not quite sure what's going on. If you go to /community/index.php you get 200 OK but if you go to /community/discussions you get another 404 Not Found despite the page loading fine.
I like the idea of putting the forum on a subdomain but that would cause problems with the login as it would have to span across both domains - might see if I can try and do this.
Not sure I like explicitly putting the header in - doesn't this mean that genuine 404s would show as a 200??
Vanilla doesn't return 404s anyway on not found pages. Your server will (and still will) on random URLs in Vanilla's space, but Vanilla will return a simple 'discussion not found' message instead of a 404 if it looks close enough to be a valid Vanilla URL.
I think Wordpress is overstepping by assuming the Vanilla URLs are invalid and inserting the 404, so we just write over it. The alternative would be to dig through Wordpress' code and change it's logic, or stop wrapping Vanilla inside Wordpress (which wouldn't necessarily require a subdomain)
Note also that one of the above linked threads mention that putting bbpress in a subdomain didn't work...
appg/init_vanilla.php would probably be the best place if you want to put your header right at the top. You might try WallPhone's suggestion and have a rifle through WordPress' code too as it seems WordPress is what's generating the false headers.
Managed to get it to work by placing the header statement directly underneath where I include wp-blog-header.php (from Wordpress). Thanks for your help everyone!