I'm using Zend Framework 2 for developing an application in PHP. Everything works locally (apache server on linux).

But now I have to deploy my site to a Windows Server (using IIS, on Azure).

As IIS doesn't read the .htaccess I have to rewrite it on a web.config file. This is what I've done using the IIS7 import rewrite rule feature. [More informations here](http://www.iis.net/learn/extensions/url-rewrite-module/importing-apache-modrewrite-rules).

Unfortunetly ISS can't translate the rules to the web config..

This is where I need your help.

Here is my .htaccess file (default one from Zend Framework 2)

```
RewriteEngine On
# The following rule tells Apache that if the requested filename
# exists, simply serve it.
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
# The following rewrites all other queries to index.php. The 
# condition ensures that if you are using Apache aliases to do
# mass virtual hosting, the base path will be prepended to 
# allow proper resolution of the index.php file; it will work
# in non-aliased environments as well, providing a safe, one-size 
# fits all solution.
RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]

```

Edit
----

After some researches I've found that -s and -l (first two conditions) can be replaced with -f. Perfect!

So my real problem is focused on the last two rules. (ISS can convert the E=.. and the ENV:.. syntax)