PHP: AJAX: Get: 不正确的网址


PHP: AJAX: Get: incorrect URL

我正在将我的应用程序移动到新服务器,最近遇到了一些问题。PHP version: 5.5.34 , Mac OSX Apache 2.4

拉维尔版本:4.2

我得到一个网格,但我的浏览器抱怨 URL。

我的 ajax 请求如下所示:

$(grid_name).jqGrid({

    //to get this function working make sure you've .htaccess file  
    //url:'illumina_xhr_get_data', - won't work if not added illumina 
    url:"illumina/illumina_xhr_get_samples",
    //url:"illumina/illumina_xhr_get_samples",
    datatype: "json",
    mtype: "GET",
    jsonReader: {
        repeatitems: false,
        id: "",
        root:  function (obj) {
            return obj;
        },
        records: function (obj) {
            return obj.length;
        },
        page: function () {
            return 1;
        },
        total: function () {
            return 1;
        }
    },
    colNames:['Study','Sample Name','Forward Primer',
            'Reverse Primer','Region','Read Length','Seq Platform', "ID"], //id is hidden.. that is used while making group
    colModel :[ 
               {name:"study_name",sortable: true}, 
               {name: "sample_name",sortable: false},
               {name: "forward_primer",sortable: false},
               {name: "reverse_primer",sortable: false},
               {name:"region",sortable:false},
               {name:"read_length",sortable:false,align:'right'},
               {name:"seq_platform",sortable:false},
               {name:"id",sortable:false,hidden:true}
               ],
        rowNum:10, //this sets the default row in the pager
        caption:"Illumina", //title of the grid
        pager: pager_name,  
        shrinkToFit : false,
        rownumbers: true, //row numbers on left
        multiselect: true, //check box
        height: '400', //height: 'auto',
        width: '1100',
        gridview: true,         
        viewrecords:true, // this is for the View 1 - 8 of 8 'm/
        sortorder:"asc", //asc 
        autoencode: true, //don't know
        sortable:true, //sort
        loadonce: true, //loadonce is must
        rowList:[500,1000,1500], //drop down
        page: 1,
        rowNum: 100,
        ignoreCase: true, //make search as case insenstive -- YAY.. Party
        grouping:true, //this is for grouping
        groupingView : { groupField : ['study_name'], //grouping based on study column
            groupText : ['<b>{0} - {1} Sample(s)</b>'] //this will give count of samples present
             } ///grouping view ends
});

'

错误:

The requested URL /pims/public/illumina/illumina_xhr_get_samples was not found on this server.

我的本地主机指向~/Sites

相同的代码适用于我的另一台机器(我正在从中转换)。

我无法找到解决方案。请帮忙。

我从以下位置找到了解决方案: .htaccess:无效命令"RewriteEngine",可能拼写错误或由服务器配置中未包含的模块定义

我会启用重写模块以便它被服务器读取。

我在/var/log/apache2/error_log中发现错误

希望它对某人有所帮助。谢谢。