.htaccess - Jquery post is not working due to htaccess file in Codeigniter -


i placed .htaccess code remove index.php url in amazon server. after placing jquery post function not working me.please me issue.here .htaccess code.

 <ifmodule mod_rewrite.c>     rewriteengine on     rewritebase /      #removes access system folder users.     #additionally allow create system.php controller,     #previously not have been possible.     #'system' can replaced if have renamed system folder.     rewritecond %{request_uri} ^system.*     rewriterule ^(.*)$ /index.php?/$1 [l]      #when application folder isn't in system folder     #this snippet prevents user access application folder     #rename 'application' applications folder name.     rewritecond %{request_uri} ^application.*     rewriterule ^(.*)$ /index.php?/$1 [l]      #checks see if user attempting access valid file,     #such image or css document, if isn't true sends     #request index.php     rewritecond %{request_filename} !-f     rewritecond %{request_filename} !-d     rewriterule ^(.*)$ index.php?/$1 [l] </ifmodule> <ifmodule !mod_rewrite.c>     # if don't have mod_rewrite installed, 404's     # can sent index.php, , works normal.     errordocument 404 /index.php </ifmodule> 

and jquery post code is

$.post("<?php echo base_url();?>user/createfile", {newfile: value},function(result) { $('#create').hide(); }); 

try

 $.post("<?php echo site_url('user/createfile'); ?>", {newfile: value}).done(function(result){      alert(result);         $('#create').hide();           }); 

use site_url instead of base_url()


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -