Options -MultiViews
RewriteEngine on
# remove php
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{REQUEST_URI} !/index\.php$
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R=301,L]
# rewrite with php php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/accounts-admin/$1.php -f
RewriteRule ^(.+?)/?$ $1.php [L]