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.


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?


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


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

  • What exactly is the error that you are getting from IIS7? Are you attempting to do some type of URL re-write?
    – Chris
    Dec 7, 2009 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 7, 2009 at 15:23

1 Answer 1


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.

  • 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 <defaultDocument> element in the <system.webServer> 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 8, 2009 at 7: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 <location path=...> tags is where you could set it at the global level, or within <location path=...> 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) Dec 8, 2009 at 20:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.