Which is the new name of the variable? Are you using a JS framework like jQuery or MooTools?
Almost the same problem here, but I guess it's due to the variable value not the name.
Let me explain:
I'm using a custom template file for Ajax inclusion (and loading wp-blog-header.php) as your bloader.php does.
Javascript detects internal links (This ensures compatibility when JS is not activated) and convert those URLs in order to make them point to the loading php, like this:
var BlogURL = "http://www.domain.com";
var TemplateURL = "http://www.domain.com/wp/wp-content/themes/mytheme";
if(PassedUrl.indexOf("?page_id=") != -1) {
AjaxUrl = PassedUrl.replace(BlogURL + "/?page_id=",TemplateURL + "/pagecontent.php?pageid=");
}
else {
AjaxUrl = PassedUrl.replace(BlogURL + "/",TemplateURL + "/pagecontent.php?pagename=");
}
Then pagecontent.php processes the URL query string variable to catch the content to be included:
<?PHP define('WP_USE_THEMES', false);
$wp_blogheader = ("../../../wp-blog-header.php");
require_once($wp_blogheader);
if(isset($_GET['pageid'])) {
$pag = $_GET['pageid'];
}
elseif(isset($_GET['pagename'])) {
$pag = $_GET['pagename'];
}
global $post;
// TRANSLATION FUNCTIONS OMITTED
if(isset($_GET['p'])) {
$page_data = get_post( $pag );
}
if(isset($_GET['pageid'])) {
$page_data = get_page( $pag );
}
elseif(isset($_GET['pagename'])) {
if(function_exists('qTranslateSlug_get_page_by_path')) {
$pag = qTranslateSlug_get_page_by_path($pag, $q_config['language']);
$page_data = get_page( $pag );}
else { $page_data = get_page_by_path( $pag );}
}
$content = $page_data->post_content; // Get Content
$title = $page_data->post_title; // Get title
echo do_shortcode($content);
?>
Since I'm using the qTranslate plugin to have multiple languages content available in any page, some features has to be checked.
That's where I'm getting 404 errors.
Basically, the translation functions strip the language code from the page name variable, passed in the URL string, to get the default page (the only one which really exists). That language code is therefore stored and applied in php, to filter the content by the appropriate language (since in pagecontent.php it starts from default).
So when the URL of the Ajax call is
www.domain.com/wp/wp-content/themes/mytheme/pagecontent.php?pagename=my_page/my_subpage it DOES work
but when it's
www.domain.com/wp/wp-content/themes/mytheme/pagecontent.php?pagename=en/my_page/my_subpage it throws out 404 error and nothing is displayed.
After some debug testing, the only difference was the variable value in the URL, the $pag = $_GET['pagename'];
input to the translation function. In fact, the output (before the DB query) is the same, correct one as it should be according to the purpose of the function.
The strangest thing is that the Firebug console shows the 404 (like the server access log) but the response raw content and html tabs print the correct page!
Moreover, when opening www.domain.com/wp/wp-content/themes/mytheme/pagecontent.php?pagename=en/my_page/my_subpage in another window, it DOES display (log html status 200, not 404). Obviously, changing variable "pagename" to "page_name" has no effect.
Everything used to work fine before upgrading to WP 3.0.1, this leads me to think that my Javascript and my custom inclusion/translation php are still correct, where something in the new WP version could pre-parse the custom query string and block it according to its default page criteria.
However, I still can't figure out how and in which case could a php problem/misspelling result in a 404 of XMLHttpRequest.