[wp-hackers] Getting a 404 error when requesting a .php file as a stylesheet in WP 3.0.1

David Morris dvmorris at gmail.com
Tue Sep 7 16:38:02 UTC 2010


Before I posted this last week I could have sworn that I deleted all of the
code in that file and still received a 404, but I must have been mistaken.
It turns out that the original developer of this theme used this line at the
top of the file:

require('../../../wp-blog-header.php');

That was causing WP 3.0 to throw a 404 error AND serve up the correct
content, which is a weird behavior that causes mixed reactions across
browsers. Anyways, the quick fix I put in was to just replace that line with
this:

@require('../../../wp-config.php');
@$wp->init();

This is obviously not ideal, but I just needed a really quick fix until we
overhaul the theme at a later date. If there is an even better quick fix,
let me know. When we overhaul it, I will be moving to a parent-child theme
approach where style customizations are done in the child theme's style.css
file instead of in a php file.

Thanks for your help guys,

Dave


More information about the wp-hackers mailing list