Question

I am creating a CMS where it is my desire to make use of CNAME to allow clients to use their domain name but have the entire site hosted and run off of my server. I have been searching for answers to the following questions but to no avail. Assistance would be appreciated.

1] Can a CNAME be set up to run off dynamic pages and...

2] Will the client's domain name appear in the url address bar of the links pages when dynamic links created for the client's site are clicked or will the url revert to my domain on subsequent dynamic page and...

3] Is in necessary to create a folder for each client or can I simply use dynamic pages from the top level of my domain and...

4] If a separate folder is necessary, does it have to be a sub domain?

Thanks in advance... it is important for me to have this understanding before I begin the programming aspects of my intended purpose.

Any ideas and recommendations are surly welcomed.

Pete

Was it helpful?

Solution

A CNAME record is an abbreviation for Canonical Name record and is a type of resource record in the Domain Name System (DNS) used to specify that a domain name uses the IP addresses of another domain, the "canonical" domain.

http://en.wikipedia.org/wiki/CNAME_record

It's used to map a domain name to another domain name, the latter of which should have an A record with an IP address.

  1. So in your case, you could certainly have a CNAME record for each of your clients. All of those aliases could point to your primary, "canonical" domain name.
  2. The browser will not change the URL. But how the URL changes with clicks around your site depend on how you have coded the HTML. If they are relative links, the browser won't change the domain. If they are absolute links, the URL would change.
  3. If the site will behave the same for all users, there should be no need to duplicate code in multiple folders. However, if you need the site to behave differently depending on which client is accessing it (e.g. headers, logos, colors), you will need to detect which client is accessing the pages. You should be able to do this by examining the URL and have your code dynamically adjust the content as necessary. You shouldn't need separate code if the sites are to behave similarly.
  4. A separate folder should not be necessary, and even if it were, you wouldn't need a sub-domain. Usually, web servers have the capability of examining host headers to detect the URL, and different web sites at the same IP address can have different sets of code.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top