Answer the question
In order to leave comments, you need to log in
How to remove .php extensions so that POST requests to a php file work correctly?
Good!
I removed extensions from files via htaccess .php, but there is a php file that gives a 301 response when a POST request is made.
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^\ ]+)\.php
RewriteRule ^/?(.*)\.php$ /$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^/?(.*)$ /$1.php [L]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question