If there’s no dependencies inside the root
Application.cfc outside of what you’ve outlined, then these two are equivalent:
<cfset this.webroot = GetDirectoryFromPath(GetCurrentTemplatePath())>
<cfset this.webroot = this.webroot & "/site1">
In other words, you could just use
GetDirectoryFromPath(GetCurrentTemplatePath()) in site1\Application.cfc instead of including the root Application.cfc and then using
this.webroot & "/site1".
Beyond that, however, the more common approach is to use the same
this.name in all of your
Application.cfc's which allows sub-folders of the root to inherit the properties defined in the root Application.cfc. So, if you have additional dependencies beyond
this.webroot then that’s probably a better approach. And, in which case,
this.webroot = GetDirectoryFromPath(GetCurrentTemplatePath()) in each Application.cfc would be used.
EDIT: Quick caveat now that I think of it… you say you’re browsing to the subfolder so the above
this.name approach should work (assuming you have dependencies outside of the
this.webroot that aren’t already resolved by my first suggestion).
If, however, you were to have a domain/site/vhost pointed to that subfolder then the webroot would be that subfolder and the parent (root) Application.cfc would not be invoked. Just something to keep in mind with the
this.name approach - it requires the root Application.cfc to always be webroot.