I am working on a website which i am going to develop as a CMS. So i am writing .htaccess file. page link and url working fine, but when i performing ajax request then i am getting 404 error for the url. I am placing my .htaccess file code and the ajax request which i am calling.
.htaccess file
RewriteRule ^single _single_Page.php [NC,L]
RewriteRule ^single/([A-Za-z0-9-]+)/?$ _single_Page.php?subid=$1 [NC,L]
RewriteRule ^findcontents/([A-Za-z0-9-]+)/?$ _findContentTitle.php?data=$1 [L,QSA]
AJAX request using JQuery
$('.search').keyup(function(e){
var data=$(this).val();
data="data="+data;
$.ajax({
url:'/findcontents',
type:'POST',
data:data,
success:function(result){
if(result==""){
$('.result p').html("No result found.<br>Please make correct search.");
}else{
$('.result p').html(result);
}
$('.result').css('visibility','visible');
},
error:function(error){console.log(error);}
});
});
Please friends tell me where i am wrong, as i need to fix it out as soon as possible.
Thanks....