Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter 3 - 403 Forbidden on POST from jQuery.ajax() asynchronous request
#3

Preset Apache mod_rewrite Flags modified RewriteRules causing AJAX requests to fail.The solution is either:

1. Deactivate mod_rewrite if you can on your hosting (not recommended)

2. Change .htaccess of codeigniter installation from:

Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
RewriteCond $1 !^(index\.php|images|robots\.txt)

to:

Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
$string = $this->load->view('return_view_as_data', '', TRUE);
Reply


Messages In This Thread
RE: CodeIgniter 3 - 403 Forbidden on POST from jQuery.ajax() asynchronous request - by josephgodwinke - 04-20-2021, 12:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB