Ticket #2984 (closed defect: worksforme)

Opened 2 years ago

Last modified 2 years ago

404 response header on js.php file

Reported by: ttscoff Assigned to: anonymous
Priority: normal Milestone:
Component: General Version: 2.0.4
Severity: normal Keywords: 404 bug
Cc:

Description

I've been working (unoffically) on the Extended Live Archives Plugin. There was a problem that quite a few users were experiencing where no archives were showing up and no errors or AJAX transactions were reported. I found that the PHP as CGI file was returning valid javascript, which was properly embedded in the generated source for the page. But when I accessed the php file directly, it showed up fine, but with a response header of 404 Not Found. This caused it to be ignored by all browsers except Safari (Mac). I modified the functions.php file temporarily to force a 200 on these pages, but I'm fully aware that this is a poor solution. What I'd really like to know is what is causing these 404 headers on this particular script?

I'm running Apache/1.3.37 with mySQL 4.0.25. Wordpress 2.0.4

The offending file can be seen here, and if you check the response headers, you'll see the 404 error. http://blog.circlesixdesign.com/wp-content/plugins/af-extended-live-archive/includes/af-extended-live-archive.js.php

Thanks for any assistance.

Brett

Attachments

functions.php (71.1 kB) - added by ttscoff on 07/30/06 13:06:42.

Change History

07/30/06 13:06:42 changed by ttscoff

  • attachment functions.php added.

07/30/06 13:09:10 changed by ttscoff

My apologies, with my modified functions.php you won't get the 404 error on the linked file. Let me know if you'd like me to revert it so you can see the error.

Thanks, Brett

08/24/06 21:27:12 changed by ttscoff

Bump. Anyone have a comment on this?

11/27/06 23:09:39 changed by xurizaemon

Bump. This code shouldn't generate a 404 header in an external file that wants to access WP things, but rather only if WordPress can't find the content.

My js.php file parses fine, but WP(2.0) returns a 404 header as a special bonus. So (as a crude workaround) I just rewrote the headers I didn't like, once wp-blog-header.php had done its filth.

Alternatively, some other non-404ing method should be available to use WP's functions without it owning the headers. (Perhaps I missed that in the docs.)

<?

define('WP_USE_THEMES', false) ; require('../../../wp-blog-header.php'); header("HTTP/1.1 200 OK"); header("Status: 200 All rosy") ;

?>

404 should only get set IF wordpress really is dealing with the request, IMO.

11/27/06 23:10:47 changed by xurizaemon

<?
  define('WP_USE_THEMES', false) ;
  require('../../../wp-blog-header.php'); // i'm in wp-content/themes/js.php
  header("HTTP/1.1 200 OK");  // else we get 404
  header("Status: 200 All rosy") ; // what should this really say?
 ?>

03/31/07 10:38:21 changed by Nazgul

  • status changed from new to closed.
  • resolution set to worksforme.

Unable to reproduce this on my blog.