首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用于Zend Framework的Windows Azure重写规则

用于Zend Framework的Windows Azure重写规则
EN

Stack Overflow用户
提问于 2013-12-03 06:06:18
回答 1查看 230关注 0票数 0

目前,我的apache上有以下htaccess:

代码语言:javascript
复制
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文件,配置如下:

代码语言:javascript
复制
<?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的推荐配置是什么?

提前感谢您的帮助!

EN

回答 1

Stack Overflow用户

发布于 2014-07-18 17:50:57

我知道这个问题有点老了,但是如果你没有解决你的问题,这里有关于如何在IIS上配置Zend Framework的答案。

Zend Documentation for IIS

但也许您的问题还在于设置文档根目录。你不应该将你的重写指向"public/index.php“,而仅仅是"index.php”,然后设置正确的文档根目录。

这是我为Azure网站回答的问题:Azure Websites仍在等待Azure云服务的答案:Azure Cloud Services

当你自己配置IIS时,Azure VM应该是自解释的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20338894

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档