direct user pages

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Im not too sure how to go about this. I am working on a project where i
have users register on the site and when they do they need to be
assigned a url like this . Kind of like
it is on myspace. I was thinking
1) using a php script to have cpanel create a subdomain for each user.
2) when the register have a folder created somewhere then have a 401
page seach the data base for the /username at the end of the url then
direct to the correct page.

Am i way off base.
I appreciate your help

Site Timeline