Do you using IIS mappings or virtual directories for this structure? Or perhaps, CF mappings to implement this?
-----Original Message----- From: Steve 'Cutter' Blades [mailto:[email protected]] Sent: Monday, February 21, 2011 8:33 AM To: cf-talk Subject: Re: Feedback on this approach to "many sites, one codebase" (MSOC) I'm going to talk more about file structure in a post on my MSOC series, following my current discussions breaking down application event handlers. My experience shows having one base path to a SiteSpecific root: \\(some drive share\SiteSpecific Then I use a subfolder for each site: \\(some drive share\SiteSpecific\225 \\(some drive share\SiteSpecific\256 I then place all assets for a site in their SiteSpecific folder, and use a consistent naming convention for each: \\(some drive share)\SiteSpecific\(siteId)\assets\ \\(some drive share)\SiteSpecific\(siteId)\assets\images \\(some drive share)\SiteSpecific\(siteId)\assets\css \\(some drive share)\SiteSpecific\(siteId)\assets\scripts \\(some drive share)\SiteSpecific\(siteId)\assets\documents I also have a specific set of directories for app specific assets that are not adjustable by end clients: \wwwroot\assets\ \wwwroot\assets\images \wwwroot\assets\images\icons \wwwroot\assets\css \wwwroot\assets\scripts This way, if I decide to change my SiteSpecific root (like moving it all into S3), it's a matter of changing one variable (the site specific root) to affect all sites. Steve 'Cutter' Blades Adobe Certified Expert Advanced Macromedia ColdFusion MX 7 Developer ____________ http://blog.cutterscrossing.com Co-Author "Learning Ext JS 3.2" Packt Publishing 2010 https://www.packtpub.com/learning-ext-js-3-2-for-building-dynamic-desktop-st yle-user-interfaces/book "The best way to predict the future is to help create it" On 2/17/2011 12:31 PM, Rick Faircloth wrote: > 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:342466 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

