Using the URL Rewrite, that Sam Cogen mentioned, which is automatically installed in any discount asp.net account (and which can be installed to any IIS7 server), I created a rewrite rule to solve my problem.
Note: The staff at discount asp.net said that a rewrite rule is the only way to accomplish this on one of their accounts besides a programmatic script. Discount asp.net provides a programmatic (I say hack) script that will route subdomains to subdirectories, but I needed more flexibility and performance than such a solution would provide.
If the IIS 7 rewrite module is not installed, you will have to find the module (probably at microsoft's IIS website), and then install it.
Once the rewrite module is installed in IIS, connect to it using the IIS Manager.
Make sure you have the root level of the website selected when you create the rule (rather than the subdirectory where your application is), this is very important because it led me to a critical mistake that wasted some time. The rewrite rules can be applied at different levels in the directory hierarchy, causing a rule to have different effects depending on where in the directory hierarchy the rule is located (I believe it makes a change to the local web.config, when a rule is created, but I have not taken the time to confirm this). This also means that you can't see the rules set in other directories when you are altering rules in another directory.
Selecting the root directory for the rewrite is important because you want to reroute all subdomain urls to the subdirectory url (except ones already routed to the subdirectory).
Having selected the root site directory, double click URL rewrite, to enter the rewriting area. Then click Add Rule(s) and create a Blank Rule.
For the matching
Pattern use: ^(?!serverone/)(.*)
and set
Requested URL: to 'Matches the Pattern', and
Using to Regular Expressions.
This will route any url through this rule, ignoring those that are already headed to the correct subdomain but we want to restrict the rewrite from routing stuff that doesn't have the subdomain in the url, so next we will add a condition.
It only needs one condition, using {HTTP_HOST}
for input, and the pattern for it is:
s1.site.com
Finally for the Action, you need an 'Action Type' of 'Rewrite' that appends the query string value.
The rewrite url should be: serverone/{R:0}
.