I have a multi-tennant website that I'm migrating from IIS5 on Win 2000 to IIS7 on Win Server 2008 64bit.
Every tennant has their own domain name that they point to the application server's IP address.
Then we set up a site in IIS for each domain name and set the physical path to the path where our (classic) ASP files are located.
For each site, I want to set up a default document that runs an ASP file and passes the CompanyID in the querystring.
www.site1.com would call Connect.asp?CompanyID=425
www.site2.com would call Connect.asp?CompanyID=426
To achieve this on IIS7, I have a web.config file in the root physical path of the ASP files which looks like this:
<?xml version="1.0" encoding="UTF-8"?> <configuration> <location path="www.site1.com"> <system.webServer> <defaultDocument> <files> <add value="Connect.asp?CompanyID=425" /> </files> </defaultDocument> </system.webServer> </location> <!-- a location entry for every other website here... --> <location path="."> <system.webServer> <defaultDocument> <files> <add value="Connect.asp?CompanyID=1" /> </files> </defaultDocument> </system.webServer> </location> </configuration>
This is not working - all the sites are going to the CompanyID=1 entry.
Can someone point out what I'm doing wrong?
I've tried setting the path attribute to
- the domain name
- the friendly name of the site in IIS
either way it doesn't work.