03-05-2017, 03:58 AM
I'm using the .htaccess code below to hide .php in the url. It works fine, however all POST requests do not work afterwards. For example, all form submissions stopped working unless I changed them to GET.
Please help take a look why this is happening and a way out.
Please help take a look why this is happening and a way out.
Quote:Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
# RewriteBase /
# To externally redirect /dir/foo.php to /dir/foo
RewriteCond {3bc1fe685386cc4c3ab89a3f76566d8931e181ad17f08aed9ad73b30bf28114d}{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ {3bc1fe685386cc4c3ab89a3f76566d8931e181ad17f08aed9ad73b30bf28114d}1 [R,L,NC]
## To internally redirect /dir/foo to /dir/foo.php
RewriteCond {3bc1fe685386cc4c3ab89a3f76566d8931e181ad17f08aed9ad73b30bf28114d}{REQUEST_FILENAME}.php -f [NC]
RewriteRule ^ {3bc1fe685386cc4c3ab89a3f76566d8931e181ad17f08aed9ad73b30bf28114d}{REQUEST_URI}.php [L]