I am working on several projects that I want to build affiliate sites from. Each new affiliate would have the same content and look, but the content would be customized for that affiliate from their configuration settings. I would like each affiliate to be able to have an assigned sub-domain that would access their customized promotional content, lead tracking, etc etc.
So, to be clear, this is what I want to create. The main domain would be the same site that would be customized (but not cloned) for each affiliate. Bob's sub-domain (bob.maindomain.tld) would be a window to his affiliate marketing details, presenting links associated to his affiliate account (http://bob.maindomain.tld/signup, .../invite-others, .../links, .../bobs-profile, etc). The affiliate sub-domain would then be able to have all sub-domain based interactions tracked separately and all traffic sent to that affiliate's sub-domain would stay theirs (they wouldn't loose the traffic that they worked hard to get to other affiliates).
So now that you know what I am looking to accomplish. How would I work with sub-domains, .htaccess files, and silverstripe to serve up the templates and primary content from the maindomain.tld but then fill in appropriate sub-domain based content from the affiliate's data stored in their personal login?
I welcome ideas, code samples, .htaccess file samples, and best practices for running this all with https:// SSL, tracking cookies, etc
My first and greatest focus with this question is working with sub-domains, .htaccess and serving up the same template with custom content on a per sub-domain basis. Please let me know if any of this needs further clarification.
Thank you in advance for your expertise, your time, your consideration and care for a fellow developer. I appreciate all of you wonderful people who spend hours and hours helping others to become more knowledgeable and make better software and client solutions. You are the best! ;-)