在服务器,上传的应用程序上安装ZF,现在接收404?

时间:2011-03-31 09:05:47

标签: php zend-framework iis

我最近在运行IIS7&amp ;;的服务器上安装了Zend Framework。 PHP5。

我已将应用程序上传到使用ZF构建的服务器。

索引控制器渲染正常; Zend_Form登录表单按预期构建,这意味着ZF安装正常运行。

但是,当执行登录并在索引控制器中调用$this->_helper->redirector('index', 'reseller');时,我会收到来自服务器的404消息!

任何可能导致此问题的想法?

非常感谢

编辑:

我被重定向到的网址是(这是正确的):

http://mydomain.co.uk/public/reseller

请求物理路径(这可能是问题!):

D:\vhosts\mydomain.co.uk\httpdocs\public\reseller

(这是'经销商'控制器,'索引'动作,是应用程序的一部分)。 enter image description here

1 个答案:

答案 0 :(得分:0)

这是通过将web.config XML文件添加到应用程序的公共目录中来解决的:

<?xml version="1.0" encoding="UTF-8"?>
<!--<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Imported Rule 1">
                    <match url="^[\w/\%]*(?:\.(?!(?:js|ico|gif|jpg|png|css|html)$)[\w\%]*$)?" />
                    <action type="Rewrite" url="/index.php" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>-->
<configuration>
     <system.webServer>
         <rewrite>
             <rules>
                 <rule name="Imported Rule 1" stopProcessing="true">
                     <match url="^.*$" />
                     <conditions logicalGrouping="MatchAny">
                         <add input="{REQUEST_FILENAME}"
                             matchType="IsFile" pattern=""
                             ignoreCase="false" />
                         <add input="{REQUEST_FILENAME}"
                             matchType="IsDirectory"
                             pattern="" ignoreCase="false" />
                     </conditions>
                     <action type="None" />
                 </rule>
                 <rule name="Imported Rule 2" stopProcessing="true">
                     <match url="^.*$" />
                     <action type="Rewrite" url="index.php" />
                 </rule>
             </rules>
         </rewrite>
     </system.webServer>