You should, in general, exclude all real files and directories, as this will handle css / js / images / whatever you want to serve:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)$ profile.php?username=$1 [L]
source
share