I am new to htaccess and I am having trouble with POST values through AJAX.
Everything worked before I started playing with htaccess so it is probably a simple fix.
My post values are being lost through AJAX and I think it is because I have rewritten the urls to remove the suffix (php) using htaccess. I had some trouble with POST values on the normal scripts (ie login) which was solved by adding a rewrite condition.
Please see below my code:
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
## hide .php extension
# To externally redirect /dir/foo.php to /dir/foo
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L,NC]
## To internally redirect /dir/foo to /dir/foo.php
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^ %{REQUEST_URI}.php [L]
RewriteCond %{REQUEST_METHOD} !POST
RewriteRule ^index.php / [L,R=301]