Php AJAX调用404';在暂存服务器上重新启动

Php AJAX调用404';在暂存服务器上重新启动,php,jquery,ajax,wordpress,Php,Jquery,Ajax,Wordpress,我有AJAX表单提交在本地运行良好。但当推送到我的暂存服务器时,进程页面是404'ing。我也不能直接访问它,因为它是404,但是我也在服务器上检查它,并且它的100%都有正确的权限 AJAX的代码: $('body').on('submit', '.product-form', function(e){ e.preventDefault(); $.ajax({ url : '/wp-content/themes/hinge_client_theme/page-t

我有AJAX表单提交在本地运行良好。但当推送到我的暂存服务器时,进程页面是404'ing。我也不能直接访问它,因为它是404,但是我也在服务器上检查它,并且它的100%都有正确的权限

AJAX的代码:

$('body').on('submit', '.product-form', function(e){
    e.preventDefault();
    $.ajax({
        url : '/wp-content/themes/hinge_client_theme/page-templates/template-parts/template-logic/send-form.php',
        type : 'POST',
        data : thisForm.serialize(),
        before : $(".error-message").remove(),
        success : function(data) {        
            // removed for question
        },
    });
});
网络标签上的send-form.php是404ing,你知道怎么回事吗?在当地工作很好

这是一个WordPress网站,但不确定这是否会影响它,因为它在本地工作

它在登台时尝试调用的URL为:

http://staging.domain.com/wp-content/themes/my-theme/page-templates/template-parts/template-logic/send-form.php 

您必须使用这样的url进行登台

    url : '/staging/wp-content/themes/hinge_client_theme/page-templates/template-parts/template-logic/send-form.php',

因为您在“暂存”文件夹中。

如果右键单击“网络”选项卡中的条目,然后按“在新选项卡中打开”。它能把你带到页面吗?如果不是,则/wp content/可能不在您的根文件夹中。如果直接访问,则为404。可以直接在本地访问,所以这让我很困惑。检查url中的路径:在大多数情况下,它在本地主机和live server上是不同的,文件路径是错误的。您确定文件夹wp内容存在于您网站的根文件夹中吗?(公共html,htdocs)这听起来像是由于没有使用模拟实时环境DocumentRoot的虚拟主机进行本地开发而导致的问题。您是否使用类似于
localhost/project
的url进行开发,并使用
example.com