I have a registration form, when after registering, the user would get
a subdomain

http://username.domainname.com

if user enter this url (http://username.domainname.com) then get data in this path www.domainname.com/username
(username is folder name)