403禁止错误执行和ajax页面


403 forbidden error -executing and ajax page

我有一个网站,一切都很好。但是,只有当我从php调用ajax页面时,我才会收到以下错误。

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access test.php
on this server.</p>
<p>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
<hr>
<address>Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at salarypayroll.com Port 80</address>
</body></html>

它以前工作得很好,只是现在面临这样的问题。会有什么问题。。。。。。。?这是否像服务器中的任何权限或安全问题一样。。。。。。。?

我的功能:

function myfunc(){
 var test = $("#test").val();  

    $.ajax({
        type: 'POST',
        url:   'test.php',
        data:{
            "test" : test,
             },
    success: function(data) 
             {
             /*--------My code-------*/
              }     
      });
}

更改test.php文件的权限

当test.php文件不存在或test.php文件的路径无效时,会发生此错误。

检查ajax代码中的文件路径。

我也有同样的问题。

它是由查询字符串中的特殊字符引起的。

在你的情况下,可能是通过{内部数据.

您应该检查apache重写规则。

确保您的主机允许在表单帖子中使用http URL。一些主机部署了mod_sec规则,该规则阻止通过post传递http://url。