Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Administer Subdomains

Guest
Dec 08, 2009 Dec 08, 2009

Can coldfusion create subdomains?  I want to set up an administrator panel which allows a client to create subdomains on the server and point them to root directories for individualized 'child' sites.  Or point all subdomains to the same root, but have CF output tailored to data specific to each subdomain.

Also a factor, Can this be done in a 3rd party hosting environment?  Thank you to all those who reply.

674
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Valorous Hero , Dec 09, 2009 Dec 09, 2009

The basic idea to serve up different content based on domain:

First you would use the cgi <cfdump var="#cgi#"> data to determine what domain the request is comming from.

Then either in an Applicaiton.cfm or the more modern Application.cfc OnRequestStart() method to branch your code.

A basic switch case block is pretty good at handling something like this.

<cfswitch expression="#domainData#">

  <cfcase value="subdomainOne">

    .....

   </cfcase>

   <cfcase value="subdomainTwo">

   ....

   </cfcase>

<cfswit

...
Translate
Valorous Hero ,
Dec 08, 2009 Dec 08, 2009

ColdFusion doesn't have anything to do with domains at all.

If you know how to administer domains with command line syntax, then <cfexecute....> most likely can execute the same commands.

As for servering up different content base on Domains, ColdFusion can do this easily.

What you can do on the 3rd party hosting enviornment is what they let you do.  So you would have to ask each one you are considering what they support.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 08, 2009 Dec 08, 2009

something like this?:

<cfexecute   name="c:\winnt\system32\cmd.exe"   arguments="/C netstat -n"   timeout="5"> </cfexecute>

or with code from the following command-line code examples listed in the 'arguments' attribute?

To create subdomain subdom on domain example.com:

# ./subdomain --create subdom -domain example.com

or

# ./subdomain -c subdom -domain example.com

Also, any suggestions (I've never done it) on how to serve up different content base by domain?  The subdomains will be added progressively as the organization grows so the code must be flexible enough to feed data for new subdomains on the fly.

Thanks! 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 08, 2009 Dec 08, 2009

Isn't this a bit like asking Microsoft Paint to create Windows user accounts?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Dec 09, 2009 Dec 09, 2009
LATEST

The basic idea to serve up different content based on domain:

First you would use the cgi <cfdump var="#cgi#"> data to determine what domain the request is comming from.

Then either in an Applicaiton.cfm or the more modern Application.cfc OnRequestStart() method to branch your code.

A basic switch case block is pretty good at handling something like this.

<cfswitch expression="#domainData#">

  <cfcase value="subdomainOne">

    .....

   </cfcase>

   <cfcase value="subdomainTwo">

   ....

   </cfcase>

<cfswitch>

But there are other ways to handle this as well.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources