I built a LAMP web application that let's users create their own profile page where they can upload their resume and portfolio. The url for a person's profile will be something like
http://jobbank.com/user/johndoe
John Doe registers the domain name http://johndoefreelancer.com and he wants it to point to http://jobbank.com/user/johndoe. Anyone who visits johndoefreelancer.com should not be aware that it's driven by http://jobbank.com/user/johndoe. This means that the browser url should persistently show addresses such as:
http://johndoefreelancer.com/aboutme (really points to jobbank.com/user/johndoe/aboutme) http://johndoefreelancer.com/portfolio (really points to jobbank.com/user/johndoe/portfolio)
Additionally, clicking on any links [a href=""] should keep you at johndoefreelancer.com instead of sending you to jobbank.com.
My question is, what is the best way to achieve this?
I'm considering: 1) Give instructions to users on how to domain forward with masking
2) Instruct users to fillout the field $homeUrl in their User Profile information, which is saved to the database
3) In my PHP code, if $homeUrl exists, replace all [a href="$_SERVER['HTTP_HOST']"] with [a href="$homeUrl"]
Is this the right approach? Is there a better way?