Thanks, Brian... good info on the subdomains.
Re: virtual directories... I was about to say "yes", but after
looking at the directories of the sites involving the
"global site manager", I realized I didn't have any virtual IIS
directories in users' sites. (I have them for other purposes
unrelated to this "global site manager"...)
I've been setting full http and absolute paths for image and
document handling, etc. using variables and values from the database.
One reason for this is my setup for my development cycle from
the local site, to an online development site, to the full production site.
I've been using this code for establishing which type of site the
"global site manager" should be working with:
<cfif cgi.server_name contains 'localhost'>
<cfset application.domain =
'#qGetApplicationVariables.applicationLocalhostDomain#'/>
<cfset application.userImagesPathHTTP =
'#qGetApplicationVariables.applicationLocalhostUserImagesPathHTTP#'/>
<cfset application.userImagesPathAbsolute =
'#qGetApplicationVariables.applicationLocalhostUserImagesPathAbsolute#'/>
<cfset application.userDocumentsPathHTTP =
'#qGetApplicationVariables.applicationLocalhostUserDocumentsPathHTTP#'/>
<cfset application.userDocumentsPathAbsolute =
'#qGetApplicationVariables.applicationLocalhostUserDocumentsPathAbsolute#'/>
<cfelseif cgi.server_name contains 'whitestonemedia'>
<cfset application.domain =
'#qGetApplicationVariables.applicationDevelopmentDomain#'/>
<cfset application.userImagesPathHTTP =
'#qGetApplicationVariables.applicationDevelopmentUserImagesPathHTTP#'/>
<cfset application.userImagesPathAbsolute =
'#qGetApplicationVariables.applicationDevelopmentUserImagesPathAbsolute#'/>
<cfset application.userDocumentsPathHTTP =
'#qGetApplicationVariables.applicationDevelopmentUserDocumentsPathHTTP#'/>
<cfset application.userDocumentsPathAbsolute
='#qGetApplicationVariables.applicationDevelopmentUserDocumentsPathAbsolute#
' />
<cfelse>
<cfset application.domain =
'#qGetApplicationVariables.applicationProductionDomain#'/>
<cfset application.userImagesPathHTTP =
'#qGetApplicationVariables.applicationProductionUserImagesPathHTTP#'/>
<cfset application.userImagesPathAbsolute =
'#qGetApplicationVariables.applicationProductionUserImagesPathAbsolute#'/>
<cfset application.userDocumentsPathHTTP =
'#qGetApplicationVariables.applicationProductionUserDocumentsPathHTTP#'/>
<cfset application.userDocumentsPathAbsolute =
'#qGetApplicationVariables.applicationProductionUserDocumentsPathAbsolute#'
/>
</cfif>
I put all my development sites for clients under the
domain whitestonemedia.com as a subdomain. This lets me
work on whatever level; local, online-development, or production,
that I want just by choosing a different domain name in the browser.
ie...
http://localhost/inetpub/webroot/clientSite/index.cfm
http://clientSite.whitestonemedia.com
http://www.clientSite.com
Any thoughts on this? Seems to be working fine, so far.
Rick
-----Original Message-----
From: Brian Cain [mailto:[email protected]]
Sent: Thursday, February 17, 2011 12:56 PM
To: cf-talk
Subject: Re: Feedback on this approach to "many sites, one codebase" (MSOC)
I have built two applications under this method, and you are using many of
the same ideas. Mine have been up and running for years with no major
issues. In regard to the domain name issue mentioned by Russ, a simple
workaround for this is to use a bit of string parsing. You can parse out
the domain, and drop the sub domain into a separate variable to be used for
additional processing or styling. For example, take the following
theoretical URLs mydomain.com, www.mydomain.com, and blogs.mydomain.com.
Using string parsing you can always be assured the mydomain.com will always
be your primary reference point to setup DSN and any other site specific
variables that need to be set. You can then drop the sub domain "blogs" into
another variable that would allow you to modify settings for the primary
domain such as template or navigation links.
BTW, I am using IIS with virtual directories to include my code base. What
setup are you using?
Good luck,
Brian Cain
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342401
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm