Nice—thank you—that definitely helps. I have it partially working now.
The code below successfully serves airve.com/test_file and and redirects requests w/ the extension but it causes airve.com/test_file/ to redirect to airve.com and it doesn't work at all in the subfolder airve.com/test/file
#unless directory, remove trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+/)+$
http://
airve.com/$1 [R=301,L]
#redirect external .php requests to extensionless url
RewriteCond %{THE_REQUEST} ^(.+)\.php([#?][^\ ]*)?\ HTTP/
RewriteRule ^(.+)\.php$
http://
airve.com/$1 [R=301,L]
#resolve .php file for extensionless php urls
RewriteRule ^([^/]+/)*([^/.]+)$ $2.php [L]
(Adding the slash as suggested in the third rule before $2.php in the last rule caused a not found error.)
Then I tried placing an .htaccess file in the subfolder /test/ itself with the code below, which works except that it redirects everything to airve.com/test//file - is there a way to prevent that extra slash?
#unless directory, remove trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$
http://
airve.com/test/$1 [R=301,L]
#redirect external .php requests to extensionless url
RewriteCond %{THE_REQUEST} ^(.+)\.php([#?][^\ ]*)?\ HTTP/
RewriteRule ^(.+)\.php$
http://
airve.com/test/$1 [R=301,L]
#resolve .php file for extensionless php urls
RewriteRule ^([^/.]+)$ $1.php [L]