Re: Need some advice on approach...
Thanks for the wildcard idea, Isaac... that definitely sounds better! Welcome. :) -- s. isaac dealey ^ new epoch isn't it time for a change? ph: 617.365.5732 http://onTap.riaforge.org/blog ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307213 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Need some advice on approach...
Thanks for the feedback, Isaac... Welcome. Actually come to think of it, you can specify an arecord for *.domain.com as a wild-card for any values that aren't otherwise set for that domain. So you should be able to make it automatically throw people into the agents directory with just the one a-record and save yourself some hassle. :) It occurred to me when I started reading this that I was rushing when I thought through the mod_rewrite thing -- because mod_rewrite (or in your case isapi_rewrite) only goes to work after the a-record identification has already been done, so rewrite won't help you there. That's actually what I was thinking is that it could save you from having to create and manage all those a-records, but I think really just using the *.c21ar.com as a catch-all a-record should have the effect you want. I had one of those wildcards on my turnkey.to domain a while back, although I haven't done anything other than receive email with that domain name in several years. Anyway, your logic looks fine. I would definitely wrap a couple of cfqueryparams around those values in your query and probably create an agent.cfc to store in the session instead of putting individual values there. Even if all the CFC does is contain this.first_name = blah, etc. it'll be a step in the direction of encapsulating. hth -- s. isaac dealey ^ new epoch isn't it time for a change? ph: 617.365.5732 http://onTap.riaforge.org/blog ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307134 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Need some advice on approach...
Thanks for the wildcard idea, Isaac... that definitely sounds better! Rick -Original Message- From: s. isaac dealey [mailto:[EMAIL PROTECTED] Sent: Monday, June 09, 2008 8:49 PM To: CF-Talk Subject: Re: Need some advice on approach... Thanks for the feedback, Isaac... Welcome. Actually come to think of it, you can specify an arecord for *.domain.com as a wild-card for any values that aren't otherwise set for that domain. So you should be able to make it automatically throw people into the agents directory with just the one a-record and save yourself some hassle. :) It occurred to me when I started reading this that I was rushing when I thought through the mod_rewrite thing -- because mod_rewrite (or in your case isapi_rewrite) only goes to work after the a-record identification has already been done, so rewrite won't help you there. That's actually what I was thinking is that it could save you from having to create and manage all those a-records, but I think really just using the *.c21ar.com as a catch-all a-record should have the effect you want. I had one of those wildcards on my turnkey.to domain a while back, although I haven't done anything other than receive email with that domain name in several years. Anyway, your logic looks fine. I would definitely wrap a couple of cfqueryparams around those values in your query and probably create an agent.cfc to store in the session instead of putting individual values there. Even if all the CFC does is contain this.first_name = blah, etc. it'll be a step in the direction of encapsulating. hth ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307136 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Need some advice on approach...
Hi, all... I'm working on a real estate website and for the first time, I'm setting up agents' sites using subdomains. I have some ideas on how to approach this, but I thought I'd ask about those of you with experience doing this kind of thing to offer advice. First, on the folder structure. I've set up an agents folder under the root of the main broker site and setting up my standard subfolders, cfm, images, includes, etc. Is there a far better way to set up the structure? Or would I be better off to set up an independent agents site with the agents folder (or whatever it would be called) as the root folder? Does it matter? Secondly, will the folder structure I've started setting up (agents structure under the current main site webroot) allow me to create subdomains for each agents without problem? john.c21ar.com? I can use cfif's in the application.cfm (yes, still using application.cfm... I'll work on application.cfc on the next project. This is already way behind schedule to change now) to determine the agent by url variable (if they're coming to the site internally, and cgi.server_name if they're coming to the subdomain directly from outside the main site, via the subdomain name, john.c21ar.com. cfif (isdefined('url.subdomain') and url.subdomain is 'john.c21ar.com') or cgi.server_name contains 'john.c21ar.com' (Variables setup for particular agent etc, etc.) /cfif What's a better approach to using subdomains? Thanks for any advice. Rick ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307046 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Need some advice on approach...
Hey Rick. Brief recommendation. You mentioned you're using Application.cfm still - what you might want to do is add an Application.cfm in your /agents subdirectory to modify whatever the original Application.cfm did to set up the page... /root/Application.cfm original code ... /root/agents/Application.cfm cfinclude template=../Application.cfm change paths if necessary, etc ... That way you don't need to check for the subdomain to see if they're coming to one... you know, 'cause they're in that directory... however fitting them into that directory is another story. You can of course set up an a-record(?) for each agent that points to their directory, but that's a lot of configuration (or I would expect it to be) - my bet would be to use either mod_rewrite on Apache or isapi_rewrite on IIS to change the URL based on a rule, so that as far as the server is concerned any request to [not www].c21ar.com is actually to www.c21ar.com/agents/?subdomain=[not www] or to www.c21ar.com/agents/[not www]/ depending on how you structured it -- I was a little fuzzy on the details. :) hth -- s. isaac dealey ^ new epoch isn't it time for a change? ph: 617.365.5732 http://onTap.riaforge.org/blog ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307054 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Need some advice on approach...
Hi, Isaac... At this point, I was think that identifying the agent involved via the referring url or internally via a url variable would allow me to query a db for all needed variables, turn those variables into session variables, and then setup the agent pages via the session variables. I don't know much anything much about isapi_rewrite (did find that ionic has a free version, but it's functionality with II6 is a bit sketchy...), however, that approach, using folders for each agent requires duplicate code and I was thinking that it would be more efficient to use the same code with different variables. However, that may not be true and the only thing being saved by taking the code-reuse route would be server space. To clarify your statement about application.cfm... Are you suggesting putting an application.cfm in the main agents folder, and then having an application.cfm in *each* of the specific agents' folders and simply have that included application.cfm contain the specific variables needed an agent? So, that's preferable to just using one application.cfm in the main agents folder and determining the agent to use via cgi.server_name or url variables and a series cfif's and queries? Rick -Original Message- From: s. isaac dealey [mailto:[EMAIL PROTECTED] Sent: Sunday, June 08, 2008 11:29 AM To: CF-Talk Subject: Re: Need some advice on approach... Hey Rick. Brief recommendation. You mentioned you're using Application.cfm still - what you might want to do is add an Application.cfm in your /agents subdirectory to modify whatever the original Application.cfm did to set up the page... /root/Application.cfm original code ... /root/agents/Application.cfm cfinclude template=../Application.cfm change paths if necessary, etc ... That way you don't need to check for the subdomain to see if they're coming to one... you know, 'cause they're in that directory... however fitting them into that directory is another story. You can of course set up an a-record(?) for each agent that points to their directory, but that's a lot of configuration (or I would expect it to be) - my bet would be to use either mod_rewrite on Apache or isapi_rewrite on IIS to change the URL based on a rule, so that as far as the server is concerned any request to [not www].c21ar.com is actually to www.c21ar.com/agents/?subdomain=[not www] or to www.c21ar.com/agents/[not www]/ depending on how you structured it -- I was a little fuzzy on the details. :) hth -- s. isaac dealey ^ new epoch isn't it time for a change? ph: 617.365.5732 http://onTap.riaforge.org/blog ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307055 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Need some advice on approach...
To clarify your statement about application.cfm... Are you suggesting putting an application.cfm in the main agents folder, and then having an application.cfm in *each* of the specific agents' folders and simply have that included application.cfm contain the specific variables needed an agent? So, that's preferable to just using one application.cfm in the main agents folder and determining the agent to use via cgi.server_name or url variables and a series cfif's and queries? Umm... no my original thinking was just to have the one Application.cfm in the root /agents/ folder to include the root app.cfm from the parent app, so that one app.cfm in agents would run all the agents... however... if you're planning to give them urls like /c21ar.com/agents/[agent]/ then it's conceivable you could use an application.cfm in each directory to identify the agent and set up the environment for their page. I wouldn't put all the code in their individual application.cfm however if you're going to do that, I would create a function (or maybe even a CFC :) in the parent application.cfm and then in the app.cfm for the individual agent, you can just call that function to set up the environment like /agents/Application.cfm cfinclude template=../Application.cfm cfset agentEnv = CreateObject(component,agentEnv).init() / /agents/[agent]/Application.cfm cfinclude template=../Application.cfm cfset agentEnv.setup([agent]) / if that makes sense. ;) but no originally I was just thinking you would have just the /agents/Application.cfm and it would perform whatever variable testing it needed to perform to identify the agent. I suppose actually rather than another Appication.cfm in each directory you could just have an /index.cfm that includes ../index.cfm or the like - that way you've still got just the one application.cfm and really just the one page template too... unless you wanted to cache some custom layout for them in their index template. -- s. isaac dealey ^ new epoch isn't it time for a change? ph: 617.365.5732 http://onTap.riaforge.org/blog ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307062 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Need some advice on approach...
Thanks for the feedback, Isaac... I was actually planning to use url's like agent.c21ar.com and create subdomains (A records in the DNS manager) and then point those subdomains to the main agents' folder and use cfif statements to setup the variables for a particular agent's version of the site. If a visitor is coming to an agent's site from a page on the main website, then I can pick up a url variable to id the agent. If a visitor is coming to an agent's site from their domain, I can use the cgi.server_name variable to id the domain and get the agent info that way. Then I can convert the data into session variables that will be changed only if the cgi.server_name is not the same as the session.subdomain or if a url.agent_id variable is present... (I don't know if this approach is without problems or not... I guess I need to go ahead and do some testing to see if it breaks down in practice.) Do you see any problems with this approach? cfif (isdefined('session.subdomain') and session.subdomain is not '#cgi.server_name#') or isdefined('url.agent_id') cfquery name='get_agent_info' datasource='#dsn#' select * from hmls_agents cfif isdefined('url.agent_id') where hmls_agent_id = '#url.agent_id#' cfelse where domain_name = '#cgi.server_name#' /cfif /cfquery cfoutput query='get_agent_info' cfset session.agent_first_name = '#first_name#' cfset session.agent_last_name = '#last_name#' cfset session.agent_phone = '#phone#' etc... /cfoutput /cfif Umm... no my original thinking was just to have the one Application.cfm in the root /agents/ folder to include the root app.cfm from the parent app, so that one app.cfm in agents would run all the agents... however... if you're planning to give them urls like /c21ar.com/agents/[agent]/ then it's conceivable you could use an application.cfm in each directory to identify the agent and set up the environment for their page. I wouldn't put all the code in their individual application.cfm however if you're going to do that, I would create a function (or maybe even a CFC :) in the parent application.cfm and then in the app.cfm for the individual agent, you can just call that function to set up the environment like /agents/Application.cfm cfinclude template=../Application.cfm cfset agentEnv = CreateObject(component,agentEnv).init() / /agents/[agent]/Application.cfm cfinclude template=../Application.cfm cfset agentEnv.setup([agent]) / if that makes sense. ;) but no originally I was just thinking you would have just the /agents/Application.cfm and it would perform whatever variable testing it needed to perform to identify the agent. I suppose actually rather than another Appication.cfm in each directory you could just have an /index.cfm that includes ../index.cfm or the like - that way you've still got just the one application.cfm and really just the one page template too... unless you wanted to cache some custom layout for them in their index template. -- s. isaac dealey ^ new epoch isn't it time for a change? ph: 617.365.5732 ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307071 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4