Skip to main content
Participant
May 25, 2007
Question

index.cfm in wwwroot used for all IIS sites

  • May 25, 2007
  • 4 replies
  • 1254 views
I've been wrestling with this one all week... we just recently started to setup multiple sites in IIS on separate IPs, and I'm finding that accessing the root or index.cfm of any CF site always loads the index.cfm file located in our wwwroot directory rather than the index.cfm file located in the IIS site's default home directory.

Accessing any file other than index.cfm on the additional IPs displays the correct page and the sites function as they should, it's only that the wrong index.cfm file is being loaded (and curiously, though it loads the wrong index.cfm file, it still tries to look for the images relative to the site's home directory (which results in broken images) instead of relative to the location of the wrong index.cfm file being loaded).

Trusted cache, Save class files and Cache web server paths are all unchecked and the server has been reset several times in the past week.

Any help greatly appreciated!
- Jeff
    This topic has been closed for replies.

    4 replies

    haffejAuthor
    Participant
    June 4, 2007
    Well, the problem has been solved, but I'm still not entirely satisfied. I actually stumbled further into the problem by discovering that any CF file that existed in my wwwroot folder AND my separate site setup led the file in the wwwroot to be loaded for the separate site; in other words, it wasn't only index.cfm that was loading from the wwwroot, it was any file that existed in both locations. Knowing that, and also that other files that existed in my separate site but NOT in the wwwroot functioned normally, I went ahead and moved the app from our wwwroot to a subdirectory and restarted CF. Now the CF sites setup on separate IPs function as expected.

    I'm still not satisfied because I'd think that if having CF files in the wwwroot was problematic, it'd have been immediately evident to people like "duh this is your problem!" So I suspect that somehow the problem actually goes deeper and is probably related to something regarding installation/setup of either CF, IIS or the interaction between the two; your guess is probably better than mine, though!
    May 29, 2007
    Go into the CF admin click on the Caching "tab" and make sure the option "Cache web server paths" is unchecked. You cannot cache web server paths on multi-homed servers. Make sure you restart ColdFusion after changing this setting.

    Also, instead of eating up 1 IP address per site, consider using host headers. The only time you need a dedicated IP address per site is if you've got an SSL certificate associated with said site.
    haffejAuthor
    Participant
    May 29, 2007
    The home directories are already set for each site setup we have in IIS, and they're all unique. The problem is that we have 2 CF sites setup, one which has been setup for over a year and a half and existed as the only site setup in IIS, and the pages reside in the wwwroot folder; I recently added a second IP and site, and no matter what this site's home directory is set to, it tries to load the index.cfm located in the wwwroot folder rather than the index.cfm located in the site's own home directory.

    The curious part is that though the site uses the wrong index.cfm file, it still looks for the images in the correct directory (so that when the page is displayed, the images are broken, as they should be).
    Inspiring
    May 25, 2007
    Open IIS and select the site you want to manage. In the properties section there should be a setting for the site directory or home folder or something like that (I normally use apache, it's been a while since I've used IIS). Set that to root folder of your website. Then do the same for the other site.