RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-F RewriteRule ^([-_!*$@~:.a-zA-Z0-9]+)$ http://somesite.com/profile.php?username=$1