I instantiate a "paths.cfc" in the application with an "AppRootOffset"
property (if the site were at /mysite1/ then the AppRootOffset would be
"/MySite1") using that and the functions in the CFC you can calculate any
paths you need. Move the site and all you have to do is update the
AppRootOffset.
(Actually I don't even do that - the AppRootOffset is calculated
automatically using the location of the application.cfm which is assumed to
be at the root of the application.)
It works a treat.
Jim Davis
_____
From: nando [mailto:[EMAIL PROTECTED]
Sent: Monday, April 12, 2004 3:52 AM
To: CF-Talk
Subject: RE: Multiple Sites / 1 Hosting Account
I've run across a good way to do this if you happen to be using fusebox (or
similar that runs all requests through a single file).
In your index.cfm at root level, check the cgi.server_name using contains
if cgi.server_name contains "domain1.com"
cfinclude domain1/corefile.cfm
else if cgi.server_name contains "domain2.com"
cfinclude domain2/corefile.cfm
You'll need to tweak all references to images, _javascript_ and css files to
account for the extra directory level, but otherwise it works very well.
each application can be self-contained and it's completely seemless to your
users.
Original Message:
>From: "Jim Davis" <[EMAIL PROTECTED]>
>To: CF-Talk <[EMAIL PROTECTED]>
>Subject: RE: Multiple Sites / 1 Hosting Account
>Date: Sun, 11 Apr 2004 23:58:14 -0400
>Pretty much that's you're only option unless your host is willing to set up
>multiple virtual servers (most aren't).
>
>
>
>You probably don't need anything in the root application.cfm - you can do
>your redirect using nothing but the CGI variables. The only (minor)
>downside is that your URL's will be a little longer since every link will
>include the site/directory name.
>
>
>
>Jim Davis
>
>
>
> _____
>
>From: Michael T. Tangorre [mailto:[EMAIL PROTECTED]
>Sent: Sunday, April 11, 2004 11:28 PM
>To: CF-Talk
>Subject: Multiple Sites / 1 Hosting Account
>
>
>
>I have a shared hosting account and have two domains pointed at the
account.
>I want to run both sites independantly... Is it best to use a quick "cfif"
>in the root level index.cfm to push the user to the right site? As long as
>the cfapplication tags have unique name attributes the applications should
>be kept independent, yes? It would look like this:
>
>ROOT
>-Application.cfm
>-index.cfm
>SITE1
> -Application.cfm
> -index.cfm
>SITE2
> -Application.cfm
> -index.cfm
>
>How do you handle this, if you are in a similar situation? These are just
>personal sites, nothing of importance really...
>
>Thanks!
>
>Mike
>
> _____
>
>
>
>
_____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

