[英]how to configure iis for Zend
我嘗試將IIS 7配置為運行zend,而不必鍵入/public/index.php/。 如果嘗試使用此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時才有效。 如何在IIS中進行更改,以使我不再需要鍵入/public/index.php?
如果有人可以幫助我,我將非常感激。
謝謝。
在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>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.