doushe7934 2015-11-12 12:09
浏览 44

AJAX在登台服务器上调用404'ing

I have AJAX form submission working fine locally. But when pushed to my staging server the process page is 404'ing. I cannot access it directly neither as it 404's but checking on the server and its 100% there with correct permissions too.

The code for the 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
        },
    });
});

That send-form.php is 404ing on the network tab, any ideas whats going on? Working fine locally.

This a WordPress site but not sure if that is whats affecting it since it works locally.

The URL its trying to call on staging is:

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

1条回答 默认 最新

  • duanming7833 2015-11-12 13:23
    关注

    You have to use url like this for staging

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

    Because you are in folder "staging".

    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!