Some weeks ago I started to play with Zend Framework 2, and im impressed with what I have seen so far.

Lately I have started to use PHP with IIS (using the PHP manager, check it out: php.iis.net) and since everyone knows that IIS does not support .htaccess-files I had to find a way around it, after a quick search I found a blog post written by Rob Allan, but his suggestion didn’t work in my case.

By default IIS7 does not have the URL Rewrite module installed, so you have to install manually by downloading from the IIS.net webpage.

When that’s done, go to your public-folder (where the .htaccess-file is) create a new file, name it “web.config” and paste this rewrite rule:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Empirio (www.empirio.no)" stopProcessing="true">
                    <match url="^(.*)$" ignoreCase="false" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />

                    </conditions>
                    <action type="Rewrite" url="index.php" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

Restart IIS and now the routes on ZF2 should work.