I have a simple webapp that allows users to create and host their resumes online. It is written in php running on a LAMP server. They currently reside in their own subdirectory but I want to write in functionality to allow them to use their own custom domains. Ex. if they have a current page of: http://www.example.com/user1/page1 I would like them to be able to have: http://www.customdomain.com/page1. This would let them access the site from either URL and be able to choose which one would be the primary domain, that is the one that shows up in the address bar all the time.
With my wordpress installs I use a plugin to do all the heavy lifting but this app is completely in php and want to be able to roll my own code. I come across another with the solution of:
/// I think there are a few questions here, the answers so far address how to create the wildcard subdomains like username.tumblr.com, but to implement custom domains like username.com will require several steps: 1. username.com needs to point to your server (say with a DNS A record). 2. username.com is stored with the user data in your database. 3. in your PHP code you watch the CGI variables for custom domains and take appropriate action. You may also need to configure your server (apache? iis? nginx?) to route all port 80 traffic (regardless of domain) to your PHP app. ///
I get #1, with the wordpress installs I typically have my customers point their domains to my nameservers and then park their domain, then go through with the mapping. But I would like to write a script that does most of the heavy lifting like my wordpress plugin does.
Thanks