If I didn't missed anything:
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/(.+)\.php[^\s]* [NC]
RewriteRule ^ /%1 [R=301,NE,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^ %{REQUEST_URI}.php [QSA,NC,L]
Requests to /dive-sites.php
will issue a 301 redirect to /dive-sites
, appending query-strings if any.
Requests to /dive-sites
will get a 200 response with /dive-sites.php
as Content-Location
, appending query-strings if any.