title: Windows Azure rewrite rules for Zend Framework
body: <p>Currently I have the following htaccess on my apache:</p>
  
  <pre><code>SetEnv APPLICATION_ENV development
  
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} -s [OR]
  RewriteCond %{REQUEST_FILENAME} -l [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^.*$ - [NC,L]
  RewriteRule ^.*$ index.php [NC,L]
  </code></pre>
  
  <p>My application uses Zend Framework as MVC framework and currently my htaccess is in my public folder.</p>
  
  <p>On MS Azure I created a website in IIS and placed a web.config file in my root with the following 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;clear /&gt;
                  &lt;rule name="TransferToPublic-StaticContent" patternSyntax="Wildcard" stopProcessing="true"&gt;
                      &lt;match url="*" /&gt;
                      &lt;conditions logicalGrouping="MatchAny" trackAllCaptures="false"&gt;
                          &lt;add input="{REQUEST_URI}" pattern="*images*" /&gt;
                          &lt;add input="{REQUEST_URI}" pattern="*css*" /&gt;
                          &lt;add input="{REQUEST_URI}" pattern="*js*" /&gt;
                          &lt;add input="{REQUEST_URI}" pattern="*bootstrap*" /&gt;
                          &lt;add input="{REQUEST_URI}" pattern="*upload*" /&gt;
                          &lt;add input="{REQUEST_URI}" pattern="*theme*" /&gt;
                          &lt;add input="{REQUEST_URI}" pattern="*img*" /&gt;
                      &lt;/conditions&gt;
                      &lt;action type="Rewrite" url="public/{R:0}" /&gt;
                  &lt;/rule&gt;
                  &lt;rule name="Imported Rule 1" stopProcessing="true"&gt;
                      &lt;match url="^.*$" /&gt;
                      &lt;conditions logicalGrouping="MatchAll" trackAllCaptures="false"&gt;
                          &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /&gt;
                      &lt;/conditions&gt;
                      &lt;action type="Rewrite" url="public/index.php" /&gt;
                  &lt;/rule&gt;
            &lt;/rules&gt;
          &lt;/rewrite&gt;
          &lt;defaultDocument&gt;
              &lt;files&gt;
                  &lt;clear /&gt;
                  &lt;add value="index.php" /&gt;
              &lt;/files&gt;
          &lt;/defaultDocument&gt;
      &lt;/system.webServer&gt; 
  &lt;/configuration&gt;
  </code></pre>
  
  <p>The problem is that now I cannot access pages that have the following path /public/index or /public/test</p>
  
  <p>What am I doing wrong?  Is there something missing in the config?  What is the recommended config for Zend Framework on IIS?</p>
  
  <p>thanks in advance for your help!</p>