Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

headers show 404, yet page still downloads?

edited February 2008 in Vanilla 1.0 Help
Hi, 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: http://www.riskcollective.com/community/ Date: Sun, 03 Feb 2008 11:08:26 GMT Server: Apache/2.0.52 (CentOS) X-Powered-By: Lussumo Vanilla 1.1.4 Expires: Thu, 19 Nov 1981 08:52:00 GMT Last-Modified: Sun, 03 Feb 2008 11:08:26 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Set-Cookie: wwsgd_visits=18; expires=Mon, 02-Feb-2009 11:08:26 GMT; path=/ X-Pingback: http://www.riskcollective.com/xmlrpc.php Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=UTF-8 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. Does anyone have any ideas?? Thanks, Oli

Comments

  • Options
    Where's the 404?
  • Options
    oops.. Sorry I missed off the last line of that header when I copied/pasted it, which said.... 404 Not Found
  • Options
    What does you .htaccess look like?
  • Options
    RewriteEngine On Options +FollowSymLinks -Multiviews #Discussions RewriteRule ^discussions$ index.php [QSA,L] RewriteRule ^discussions/$ index.php [QSA,L] RewriteRule ^discussions/([0-9]+)$ index.php?page=$1 [QSA,L] RewriteRule ^discussions/([0-9]+)/$ index.php?page=$1 [QSA,L] RewriteRule ^([0-9]+)$ index.php?CategoryID=$1 [QSA,L] RewriteRule ^([0-9]+)/$ index.php?CategoryID=$1 [QSA,L] RewriteRule ^([0-9]+)/([0-9]+)$ index.php?CategoryID=$1&page=$2 [QSA,L] RewriteRule ^([0-9]+)/([0-9]+)/$ index.php?CategoryID=$1&page=$2 [QSA,L] #Comments RewriteRule ^discussion/([0-9]+)/([0-9]+)/(.*)$ comments.php?DiscussionID=$1&page=$2 [QSA,L] RewriteRule ^discussion/([0-9]+)/([0-9]+)/(.*)/$ comments.php?DiscussionID=$1&page=$2 [QSA,L] RewriteRule ^discussion/([0-9]+)/(.*)$ comments.php?DiscussionID=$1 [QSA,L] RewriteRule ^discussion/([0-9]+)/(.*)/$ comments.php?DiscussionID=$1 [QSA,L] RewriteRule ^discussion/([0-9]+)/([0-9]+)$ comments.php?DiscussionID=$1&page=$2 [QSA,L] RewriteRule ^discussion/([0-9]+)/([0-9]+)/$ comments.php?DiscussionID=$1&page=$2 [QSA,L] RewriteRule ^discussion/([0-9]+)$ comments.php?DiscussionID=$1 [QSA,L] RewriteRule ^discussion/([0-9]+)/$ comments.php?DiscussionID=$1 [QSA,L] #Categories RewriteRule ^categories/$ categories.php [QSA,L] #Account RewriteRule ^account/$ account.php [QSA,L] RewriteRule ^account/([0-9]+)$ account.php?u=$1 [QSA,L] RewriteRule ^account/([0-9]+)/$ account.php?u=$1 [QSA,L] #Search RewriteRule ^search/$ search.php [QSA,L] RewriteRule ^search/([0-9]+)$ search.php?page=$1 [QSA,L] RewriteRule ^search/([0-9]+)/$ search.php?page=$1 [QSA,L] RewriteRule ^search/saved/([0-9]+)$ search.php?SearchID=$1 [QSA,L] RewriteRule ^search/saved/([0-9]+)/$ search.php?SearchID=$1 [QSA,L] RewriteRule ^search/saved/([0-9]+)/([0-9]+)$ search.php?SearchID=$1&page=$2 [QSA,L] RewriteRule ^search/saved/([0-9]+)/([0-9]+)/$ search.php?SearchID=$1&page=$2 [QSA,L] #Post RewriteRule ^post/$ post.php [QSA,L] RewriteRule ^post/([0-9]+)$ post.php?CommentID=$1 [QSA,L] RewriteRule ^post/([0-9]+)/$ post.php?CommentID=$1 [QSA,L] RewriteRule ^post/category/([0-9]+)$ post.php?CategoryID=$1 [QSA,L] RewriteRule ^post/category/([0-9]+)/$ post.php?CategoryID=$1 [QSA,L] #Settings RewriteRule ^settings/$ settings.php [QSA,L] #People RewriteRule ^people/$ people.php [QSA,L] #Extensions RewriteRule ^extension/$ extension.php [QSA,L] # Prevent some little bad effects of Friendly Urls on relative links in some # extensions RewriteRule ^(discussions|categories|search|post|settings|people|[0-9]+)/(extensions|themes|images|ajax)/(.*) $2/$3 [QSA,L] RewriteRule ^(discussions|categories|search|post|settings|people|[0-9]+)/(account.php|categories.php|comments.php|extension.php|index.php|people.php|post.php|search.php|settings.php) $2 [QSA,L] RewriteRule ^discussion/([0-9]+/){1,2}[^/]*/(extensions|themes|images|ajax)/(.*) $2/$3 [QSA,L] RewriteRule ^discussion/([0-9]+/){1,2}[^/]*/(account.php|categories.php|comments.php|extension.php|index.php|people.php|post.php|search.php|settings.php) $2 [QSA,L] RewriteRule ^(discussions|account|search|post|[0-9]+)/.+/(extensions|themes|images|ajax)/(.*) $2/$3 [QSA,L] RewriteRule ^(discussions|account|search|post|[0-9]+)/.+/(account.php|categories.php|comments.php|extension.php|index.php|people.php|post.php|search.php|settings.php) $2 [QSA,L]
  • Options
    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.
  • Options
    Just found a couple of forum topics relating to this: http://bbpress.org/forums/topic/strange-404-report-i-firebug http://wordpress.org/support/topic/127302?replies=3. It seems to be a conflict between wordpress permalinks and the vanilla friendly urls htaccess file. Not sure how to fix this one.... :-| Anyone have any ideas??
  • Options
    If you put the forum in a subdomain the problem would certainly go away.
  • Options
    You might be able to overwrite the 404 with a 200, try adding this inside conf/settings.php:header("HTTP/1.1 200 OK");

    This might be something related to this: http://wordpress.org/support/topic/122089
  • Options
    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?? Hmmmm...
  • Options
    Doh - spanning the log in between the domain & subdomain shouldn't be a problem as the cookie's domain is the same as the root domain's URL.
  • Options
    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...
  • Options
    I've moved it on to a subdomain and it didn't make any difference (I wanted it on the subdomain anyway so at least it's not been a waste of time). I've also tried putting the header statement in conf/settings.php - but no luck... Is there somewhere else that I could try placing the header? Or any other ideas??
  • Options
    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.
  • Options
    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!
This discussion has been closed.