如何让Zend使用IIS 7.0(重写模块v2)和Windows 2008?

时间:2010-07-08 21:06:23

标签: zend-framework iis-7 rewrite

我的网站似乎只加载索引页面,无论它给出了什么路径。

有没有人知道让Zend正常使用IIS 7.0(重写模块v2)和Windows 2008的任何已知问题?

我对此感到绝望,无法找到合适的解决方案?

如果它有帮助,我可以放一个phpinfo()屏幕截图吗?

以下信息在phpinfo()

中设置
_SERVER["HTTP_X_ORIGINAL_URL"] /prices/ 

重写似乎在这种意义上起作用,它总是命中index.php页面,有时在主页上给出404并且没有加载正确的视图。

1 个答案:

答案 0 :(得分:2)

这是一个问题,.htaccess文件无法从IIS中modrewrite v2上的导入功能正确转换。

这是正确的标准重写配置:

<rewrite>
            <rules>
                <rule name="Zend Standard Rule" stopProcessing="true">
                    <match url="^(.*)$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <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?route={R:1}" appendQueryString="true" />
                </rule>
            </rules>
        </rewrite>

希望这有助于某人