0

/public/index.php/と入力せずにzendを実行するようにIIS 7を構成しようとしています。この URL http://<>/dev/foundation/SampleZendApp/ (ここにアプリケーションが存在します) を使用してアプリケーションにアクセスしようとすると、次のエラーが表示されます。

Message: Invalid controller specified (dev)
Stack trace:

#0 C:\inetpub\wwwroot\Dev\foundation\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#1 C:\inetpub\wwwroot\Dev\foundation\library\Zend\Application\Bootstrap\Bootstrap.php(97): Zend_Controller_Front->dispatch()
#2 C:\inetpub\wwwroot\Dev\foundation\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#3 C:\inetpub\wwwroot\Dev\foundation\SampleZendApp\public\index.php(27): Zend_Application->run()
#4 {main}  

Request Parameters:

array (
  'controller' => 'dev',
  'action' => 'foundation',
  'module' => 'default',

その前に /public/index.php を追加した場合にのみ機能します。/public/index.php を入力する必要がなくなるように IIS を変更するにはどうすればよいですか?

誰かが私を助けることができれば、私はとても感謝しています.

ありがとうございました。

4

1 に答える 1

0

iisでは少しトリッキーです。

「Bash」を開きます:-)そして実行します:

%windir%\system32\inetsrv\appcmd.exe set config ^ -section:system.webServer/defaultDocument /+"files.[value='index.php']" ^ /commit:apphost

インストールされていない場合は、iis の「書き換え」モジュールを追加する必要があります。

インストール: http://www.iis.net/download/urlrewrite

最後のステップ: web.config を webroot (.htaccess の対応部分) に追加します。

    <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="ZF Rewrite" 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>
</configuration>
于 2013-10-18T04:16:59.560 に答える