jQuery.load在WPMU中给了我一个404 Not Found

Ste*_*ven 0 wordpress jquery

我开发了一个在单个站点WP上运行良好的插件.
但是当在具有子域的WPMU上测试它时,我得到404 Not Found错误.

奇怪的是,即使我收到错误消息,内容也会被加载 - 但内容永远不会显示.

你可以在这里看到截图:http:
//www.stiengenterprises.com/download/tmp/jQuery_load_error.png

jQuery代码如下所示:

  jQuery.post("/wp-content/plugins/wp-eventcal/eventcal_jquery.php", { instance: 'getEvent', eventID: eventID },
  function(event)
  {
    alert(event); // For testing - never fires

  }, "json");
Run Code Online (Sandbox Code Playgroud)

有关如何解决此问题的任何建议?

的.htaccess

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

# END WordPress
Run Code Online (Sandbox Code Playgroud)

小智 6

出现此问题eventcal_jquery.php是因为您没有包含在Wordpress框架中,所以当它调用时,wp返回404.只需header('HTTP/1.1 200 OK');在包含wp-blog-header.php之后包含eventcal_jquery.php