【发布时间】:2014-07-18 17:50:56
【问题描述】:
目前我的 apache 上有以下 htaccess:
SetEnv APPLICATION_ENV development
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
我的应用程序使用 Zend Framework 作为 MVC 框架,目前我的 htaccess 在我的公共文件夹中。
在 MS Azure 上,我在 IIS 中创建了一个网站,并在我的根目录中放置了一个 web.config 文件,其配置如下:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<clear />
<rule name="TransferToPublic-StaticContent" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions logicalGrouping="MatchAny" trackAllCaptures="false">
<add input="{REQUEST_URI}" pattern="*images*" />
<add input="{REQUEST_URI}" pattern="*css*" />
<add input="{REQUEST_URI}" pattern="*js*" />
<add input="{REQUEST_URI}" pattern="*bootstrap*" />
<add input="{REQUEST_URI}" pattern="*upload*" />
<add input="{REQUEST_URI}" pattern="*theme*" />
<add input="{REQUEST_URI}" pattern="*img*" />
</conditions>
<action type="Rewrite" url="public/{R:0}" />
</rule>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^.*$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="public/index.php" />
</rule>
</rules>
</rewrite>
<defaultDocument>
<files>
<clear />
<add value="index.php" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
问题是现在我无法访问具有以下路径 /public/index 或 /public/test 的页面
我做错了什么?配置中是否缺少某些内容? IIS 上 Zend Framework 的推荐配置是什么?
提前感谢您的帮助!
【问题讨论】:
标签: zend-framework iis azure frameworks rewrite