Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to simulate hosting multiple domains on a single website with IIS7.

I setup a folder structure that has a web_root folder which contains a simple index.html, a web.config, and a folder (connect) holding an web application. I have attempted to add a url rewrite rule that would take a request to the host and point it into the connect folder (I added to my hosts file as well).

The web.config in web_root looks like this

        <modules runAllManagedModulesForAllRequests="true">
                <rule name="nerdfurious" stopProcessing="true">
                    <match url=".*" />
                        <add input="{HTTP_HOST}" pattern="^$" />
                        <add input="{PATH_INFO}" pattern="^/connect/" />
                    <action type="Rewrite" url="connect/{R:0}" />

When I type '' into my browser, I get the contents of the index.html file. If I type into my browser, I get a 404 error listing '' as the requested url. What am I missing?

share|improve this question

The problem was, the {PATH_INFO} rule needed to have a negate="true" attribute in the tag. This means when the pattern does not match. Since when I visited the root, "/connect/" was not in the url, and so all conditions were not met to do the rewrite action.

share|improve this answer

Your Answer


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.