Hi,
Thanks again for your help earlier.
I was finally able to resolve the issue. The problem came from a redirection rule in my .htaccess
file that was forcing all requests to index.php
to be redirected to /
, including POST
requests.
Here's the rule I had in place :
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/index\.php[?\s] [NC]
RewriteRule ^index\.php$ / [R=301,L]
This was originally added for SEO reasons, but it ended up breaking the "Add to Cart" function in EasyStore, because :
POST + 301 redirect → becomes a GET → EasyStore returns 405 Method Not Allowed
THE SOLUTION :
I updated the rule to apply only for GET requests by adding this condition:
RewriteCond %{REQUEST_METHOD} =GET
So the final working version is:
RewriteCond %{REQUEST_METHOD} =GET
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/index\.php[?\s] [NC]
RewriteRule ^index\.php$ / [R=301,L]
Now everything works perfectly — including Matomo, Redis cache, and my custom price script.
Thanks again for pointing me in the right direction!
Best regards,