修改htaccess文件以获取ajax请求

时间:2014-12-12 17:43:30

标签: php jquery ajax .htaccess

我的htaccess文件出现问题。基本上我现在这样做:

当用户在此网址上时:

http://123.org/dashboard/releases.html 

我将他们引导到这个档案:

pages/dashboard/press_releasesv4.dashboard.php

但是,在同一页面上,我使用了jQuery代码来制作Ajax请求:

$('#search-pr-btn').click(function(e){
    e.preventDefault();

    //Get the from date
    $sday = $('[name=sday]').val();
    $smonth = $('[name=smonth]').val();
    $syear = $('[name=syear]').val();
    $stime = $('[name=stime]').val();
    $from = $sday+"-"+$smonth+"-"+$syear+" "+$stime+":00";

    //Get the to date
    $eday = $('[name=eday]').val();
    $emonth = $('[name=emonth]').val();
    $eyear = $('[name=eyear]').val();
    $etime = $('[name=etime]').val();
    $to = $eday+"-"+$emonth+"-"+$eyear+" "+$etime+":00";

    //Make AJAX request 
    $('#test').load('pages/ajax/get_press_releases.php', {'from': $from, 'to': $to},function(response, status, xhr){});
});

然后我将以下内容添加到我的htaccess

RewriteRule ^dashboard/releases.html                            pages/ajax/get_press_releases.php

但是当我进入releases.html页面并按下搜索按钮时,我现在得到404。谁能帮我。

0 个答案:

没有答案