これを試して私に知らせてください。
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^profile/([^/])/? profile.php?username=$1 [L,NC]
RewriteRule ^login/submit$ login.php?action=submit [L,NC]
# /login/ will go to login.php or /contact/ will go to contact.php
RewriteRule ^([a-z0-9_\-]+)/? $1.php [L,NC]
Here's the full documentation about the []
flags: http://httpd.apache.org/docs/2.3/rewrite/flags.html