How to create dynamic Subdomain in .htaccess file?
Can any one help me how to write Rewrite Rule for it ?

when user open www.example.com then open index.php
if user open www.username.example.com then open profile.php (with user name record)

Thanks