To find out what domain is being accessed, simply look at the
cgi.server_name variable. You could use a cfswitch to check the server name
and set appropriate variables accordingly. Since in IIS (IIRC) you can set
as many domains as you want to point to a single directory, you need
maintain only one set of code (which seems to be your goal) but simply add
whatever information is needed in the application.cfm file and whatever
graphics, stylesheets, etc are necessary in order to create a new site.
For a little less flexibility (but increased ease of setup) you could simply
set a variable to the name of the domain (minus the www. and .com or
whatever) and have external files like domain.css and domain_logo.gif such
that you simply need add the external files and not worry about a switch.
I agree with Kieth that you should be setting request-scoped variables in
the application file and set them for every request, not just the first one.
If you are surfing site 1, and I go to site 2, the application variables get
reset and suddenly you are looking at site 2. I don't think that was your
intent.
As for the "sticking" site, I again urge you to check whether it could be
cached from a previous session. I say this because if the application is
actually called (that is, any .cfm file is accessed) then the
application.cfm file is run. There might be some problems with latency, but
I kinda doubt that. So, make sure that your browser isn't caching the page.
--Ben Doom
Programmer & General Lackey
Moonbow Software
: -----Original Message-----
: From: Rick Faircloth [mailto:[EMAIL PROTECTED]]
: Sent: Monday, December 02, 2002 4:16 PM
: To: CF-Talk
: Subject: RE: One dynamic site for multiple indepentdent businesses
:
:
: Hi, Ben and thanks for the reply.
:
: Yes, each business will have its own domain.
: All the files for the site will be in one folder and subfolders
: "RentalCompanies".
:
: I've been pulling the BusinessID from the bookmarked URL and
: assigning that to Application.BusinessID and using that on each page
: when needed to ID the Business. (I finally started using <CFLOCK> today
: and turned on "Full Checking" or whatever the setting is called on my
: production box,
: and went throught the site and eliminated all errors, so I guess the
: Application and
: Session variables aren't an issue any more.
:
: Can you give me an example of code concerning how to determine which
: business' info should be displayed based on domain for each page request?
: Would there have to be queries on each page to pull the graphics each time
: a page is requested? I was trying to define a persistent variable
: (Application.BusinessID)
: that would be globally available to the site. I need to query a second
: database
: based on the BusinessID key.
:
: At this point, the site is just a concept and I don't have actual domains
: yet.
: How would I work it for the temporary addresses, which are all the same at
: this point,
: except for having the BusinessID attached to the URL...
:
: One question is: Why isn't the Application.cfm page being
: accessed whenever
: I pull up a new bookmarked URL? If that would happen, I might just have
: this licked...
:
: Thanks for your help.
:
: Rick
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.