Zend Framework на iis7

Недавно установил сайт на моем сервере Windows с Zend Framework, и только страница index.php отображается правильно. Все остальные внутренние страницы выглядят так, как будто они перенаправляются на index.php, а URL-адрес переписывается как правильный URL-адрес страницы. Действительно странно, и я не могу понять, является ли это конфигурацией сервера или правилами выхода на пенсию в web.config. Любой совет был бы очень признателен. Спасибо Кам


person user459824    schedule 27.09.2010    source источник


Ответы (1)


В Windows 2008 Server с IIS 7 у меня есть следующий файл web.config для моих приложений ZF в корне сервера ("C:\intepub\wwwroot"), который позволяет мне запускать приложение так же, как на серверах Linux.

Надеюсь, это поможет вам и другим начать работу в Windows с IIS.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Get rid of the world wide web" enabled="true" stopProcessing="true">
                    <match url="^(.*)" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{HTTP_HOST}" pattern="^www\.example\.com$" />
                        <add input="{HTTP_HOST}" pattern="^$" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Redirect" url="http://example.com/{R:1}" redirectType="Permanent" />
                </rule>
                <rule name="Ignore files on the filesystem" stopProcessing="true">
                    <match url="^(.*)$" />
                    <conditions logicalGrouping="MatchAny">
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" />
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" />
                    </conditions>
                    <action type="None" />
                </rule>
                <rule name="Point to the site entry gate" stopProcessing="true">
                    <match url="^.*$" />
                    <action type="Rewrite" url="public/index.php" logRewrittenUrl="true" />
                </rule>
            </rules>
        </rewrite>
        <defaultDocument>
            <files>
                <clear />
                <add value="index.php" />
                <add value="index.html" />
            </files>
        </defaultDocument>
    </system.webServer>
</configuration>
person DragonBe    schedule 08.05.2011