title: ZF2 site on IIS 7 subdomain routing not working
body: <p>I have a shared Windows hosting account on Ez-DomainNameRegistration. I have setup a subdomain that routes to a subfolder and uploaded my Zend framework website to the folder. FYI: the website works on my local pc on IIS 7. The problem I have is that the layout of the site is correctly loaded, but the controller-action routing does not work. Instead of the view of the action I get the 404 error view. My guess is that it has something to do with the url routing.</p>
  
  <p>In the route folder (the subfolder pointed to by the subdomain) I have the following web.config file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;system.webServer&gt;
      &lt;rewrite&gt;
        &lt;rules&gt;
  &lt;rule name="Imported Rule 14" stopProcessing="true"&gt;
      &lt;match url="\.(js|gif|jpg|png|css|txt|svg)$" negate="true" ignoreCase="false" /&gt;
      &lt;action type="Rewrite" url="public/index.php{R:1}" /&gt;
  &lt;/rule&gt;
           &lt;rule name="Imported Rule 15" stopProcessing="true"&gt;
            &lt;match url="^(.*)$" ignoreCase="false" /&gt;
            &lt;action type="Rewrite" url="public/{R:1}" /&gt;
          &lt;/rule&gt;
        &lt;/rules&gt;
      &lt;/rewrite&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p>And in the public folder I have the following web.config:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
  &lt;system.webServer&gt;
  &lt;rewrite&gt;
  &lt;rules&gt;
  &lt;rule name="Imported Rule 1" stopProcessing="true"&gt;
  &lt;match url="^.*$" /&gt;
  &lt;conditions logicalGrouping="MatchAny"&gt;
  &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" pattern=""   ignoreCase="false" /&gt;
  &lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" pattern="" ignoreCase="false" /&gt;
  &lt;/conditions&gt;
  &lt;action type="None" /&gt;
  &lt;/rule&gt;
  &lt;rule name="Imported Rule 2" stopProcessing="true"&gt;
  &lt;match url="^.*$" /&gt;
  &lt;action type="Rewrite" url="index.php" /&gt;
  &lt;/rule&gt;
  &lt;/rules&gt;
  &lt;/rewrite&gt;
  &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Is there something I can change to make the routing work in side a subdomain/subfolder on iis 7?</p>