Answer the question
In order to leave comments, you need to log in
How to remove redirects in .htaccess file that interfere with ajax?
Here is my ajax request:
$.ajax({
url: '/' + url,
type: 'POST',
data: name + '_f=1' + str,
cache: false,
success: function (result) {
alert(result);
}
});
RewriteEngine on
RewriteRule /css/([^\/]+).css$ css/$1.css [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1 [L,QSA]
else if ($_POST['register_f']) {
message('регистрация');
}
Answer the question
In order to leave comments, you need to log in
You now have a server configured with a single entry point - index.php. But it looks like you don't know how to use it.
It's not difficult to remove: just delete these lines with rewrite ***.
Although it would be cooler to learn how to work with it, because it has become almost a development standard many years ago.
Your problem is not with the redirect, of course, but with the index.pohape file. Well, with logic, of course.
If your file starts to display htil for any request, then expecting that in response to an Ajax request it will display something else is at least naive.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question