For the most part, this isn't something you'd do in your application
server - you do it in your web server (for example, custom headers in IIS).
However, if you don't have access to the web server, you can do it in code.
It's no more difficult to do in CF than it is in any other language.
For example, if you use something where you funnel all requests through one
file (perhaps Fusebox, but not necessarily) and you have each site's file in
it's own directory, something like this in the application.cfm should do the
trick:
<cfset subDomain = listGetAt(cgi.server_name,1,".")>
<cfswitch expression="#subDomain#">
<cfcase value="www">
<cfset dir = "production">
</cfcase>
<cfcase value="beta">
<cfset dir = "staging">
</cfcase>
</cfswitch>
<cfinclude template="#dir#/app.cfm">
<cfinclude template="#dir#/index.cfm">
How would you normally do this in ASP? ColdFusion makes this really easy to
do because it executes the application.cfm on every request - allowing you
to put the server name checking in the application.cfm, and not in your
application (plus you don't have to remember includes on multiple files)
----- Original Message -----
From: "Les Buchanan" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, January 16, 2002 12:51 PM
Subject: RE: Multiple sites...
> Hmmm... Thanks for all the help everyone...
>
> I guess I'll just have to decide the lesser of the two "evils". =)
>
> I'm surprised that ColdFusion server doesn't have a way to handle multiple
> sites. Does anyone know if there is going to be any support for this in
> future editions?
>
> Thanks again everyone!
>
> ---Les Buchanan
>
> -----Original Message-----
> From: Tangorre, Michael T. [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 16, 2002 11:32 AM
> To: CF-Talk
> Subject: RE: Multiple sites...
>
>
> Hi Les,
>
> I do all my mapping stuff in the application.cfm file. That way, when you
> move things over, you just change a few lines in the application.cfm file.
> I set imagepath, DSN, homepath, and a few others... Makes things go real
> smnooth when moving over.
>
> Mike
>
>
> -----Original Message-----
> From: Les Buchanan [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 16, 2002 1:17 PM
> To: CF-Talk
> Subject: Multiple sites...
>
>
> Hi,
>
> I'm new on the list and to ColdFusion in general, so take it easy on me.
>
> I would like to have two (or more) sites on my NT box, one for staging,
and
> one for production. For example, I'd like to have a website
> (stage.livingscriptures.com) that I do all my pre-production work in, and
> then when I'm finished, simply copy everything over to a different
> directory, that would be my production site (www.livingscriptures.com).
>
> This is very simple to do with say, ASP, but I have found difficulty in
> getting this to work with ColdFusion. When you're trying to cfinclude
> templates, it won't include from the proper directory, without creating
> mappings in the ColdFusion administrator, and then using a variable to
store
> that mapping.
>
> My co-worker introduced my to ColdFusion, and I think it's a GREAT
product,
> but the inability to do this has frustrated me. Maybe I'm approaching
this
> the wrong way. I'd really appreciate it if someone could help me with
this.
> Thanks!
>
> ---Les Buchanan
> Newbie ColdFusion Developer
>
>
>
______________________________________________________________________
Why Share?
Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
Instant Activation � $99/Month � Free Setup
http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists