This content has been marked as final. Show 4 replies
You can use the CGI.SCRIPT_NAME variable and use the listfirst function to get the text you require.
I'd do it differantly. Set up your DNS to point all (any) hosts to your domain, so someone could type anything as the host such as subsite1.mywebsite.com and subsite2.mywebsite.com. Then you only need one application.cfm where the name of the application is the domain name with cgi.server_name. You then define your sites in the database based on their unique URL. This is also handy if you need to break your busy sites accross multiple jrun instances or servers.
You could then apply differant layout per application and differant config, directories etc. You can look at fusebox 5, since that framework can apply layouts based on variables.
Thanks, I think that provides the solution. It appears subsites can be automatically created with the cfdirectory (create) and cffile (copy) to move stub/empty files over. The stub/empty files would just contain includes bringing in the original templates and specify which database rows to retrieve based upon the CGI.SCRIPT_NAME variable. This appears to work, but is there a better way to accomplish this?
Yes, this appears to work better. Using the cgi.servername I can get the subsite and use that in the query. Thanks!