Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
    
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 '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 7 '09 at 15:23
add comment

1 Answer

up vote 2 down vote accepted

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.

share|improve this answer
    
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 '09 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) –  Scott Forsyth - MVP Dec 8 '09 at 20:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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