2

I'm upgrading a server that runs a classic asp website from iis5 to iis7

On the old server, there are sites set up that pass a querystring in the default document.
e.g CreateConnection.asp?CompanyID=1

(i.e. Different domain names all point to the same folder and the default document passes the company in the querystring.)

IIS 7 says I can't have a querystring when specifying a default document.

What can I do to get around this? The existing classic asp site works using this method.

EDIT

I've seen some sites recommend setting the default document directly in the web.config file (which would then allow me to specify the querystring), but I have the following questions about that:

I'm going to have a lot of virtual directories pointing to the same place so would there be a web.config file for each VD? If so, then where would these be located?

EDIT 2

following Scott's answer, I found a good article here: Understanding iis7 Configuration Delegation

EDIT 3

I had a lot of difficulty getting this working for my multiple sites pointing to a single physical folder on the web server (i.e. for a multi-tenant app).

If that's what you're after, see this related question: setting the default website for multiple path values in web.config

Nils
  • 195
  • 1
  • 4
  • 13
  • What exactly is the error that you are getting from IIS7? Are you attempting to do some type of URL re-write? – Chris Dec 07 '09 at 15:17
  • No, I'm in the the "Default Document" program in the IIS section of the features view of my website. Trying to add a default document as follows: "CreateConnection.asp?CompanyID=1". Then an error pops up saying that ? is an invalid character. – Nils Dec 07 '09 at 15:23

1 Answers1

2

You're right, the functionality to include a querystring with the default docs was there in IIS6 but isn't in IIS7 any longer.

What I suggest is either using URL Rewrite to append the querystring to the default doc when it's not already set, or in your code for CreateConnection.asp, have logic to handle the default there. The advantage of doing so means that someone can hit yoursite.com/CreateConnection.asp and it will work, whether it's a default doc or a direct link. I suspect that some search engine links will link to CreateConnection.asp without the querystring too.

Scott Forsyth
  • 16,449
  • 3
  • 37
  • 56
  • Thanks Scott - I think we may need to follow your suggestion. One question - is there any way to do this using web.config files for each VD and setting the element in the section? I'm just thinking that if we can set that as part of a new site setup process, then it can be a sysadmin issue and I don't have to get the developers of the software involved. – Nils Dec 08 '09 at 07:31
  • Hi Nils. Yes, you can set the rules at the site or even global level and have it apply further down. applicationHost.config in tags is where you could set it at the global level, or within tags in the site root. You can even create global rules that apply to all sites (i.e. if CreateConnection.asp is called for any site, add a particular querystring) – Scott Forsyth Dec 08 '09 at 20:43