I try to transfer website from old server to new, and stucked with one problem. PHP/JS code on both servers is the same, but on new server it is not working - $_POST data are empty in AJAX-request.
Some details:
Old server: Debian 7, Nginx + Apache(mod_php 7.4)
New server: Ubuntu 22.04, Nginx 1.18.0 + Apache 2.4.52 (mod_php 7.4)
Requested address /basket/add/. It isn't exist, .htaccess contains rule
ErrorDocument 404 /404.php
404.php contains router for logical url's, which should read $_POST and add product to basket.
I add var_dump($_POST);
at the very beginning of 404.php, but $_POST always empty array().
When the same request is going to existing file (not to 404.php), $_POST are filled normally.
So, the problem is in .htaccess directive ErrorDocument 404 /404.php
. Old server see $_POST in 404.php correctly, but new server - no.
I really can't understand, why it happens. Any ideas?