RewriteEngine On

# Check if the requested .php file actually exists before rewriting
RewriteCond %{REQUEST_FILENAME}.php -f
# Rewrite any 2-letter request to [2-letters].php
RewriteRule ^([a-z]{2})/?$ $1.php [NC,L,QSA]