You can either respond to each GET
request of user1.mysitename.com
with the same contents as www.mysitename.com/profile.aspx?username=user1
or you can answer using a redirection (HTTP 302 response) from the first url to the second url.
However, you have to first make sure the DNS server who is authoritative on mysitename.com is aware to all these domains and respond with the answer you need (either the IP of the server, or a CNAME to a domain that is linked to an IP).
EDIT:
When someone will try to surf to user1.mysitename.com
he will first try to resolve user1.mysitename.com
to get it's IP - here you need someone to let him know what is the IP of the domain user1.mysitename.com
.
After the user has the IP of the domain, he will request the page using HTTP GET
request. You need to respond to it somehow. One way is to redirect him to a different URL (www.mysitename.com/profile.aspx?username=user1
). Another way is to simply respond to the GET
request and give him the page he's looking for.