【发布时间】:2016-01-17 09:10:06
【问题描述】:
我目前正在运行 Windows Server 2012 R2,IIS 8.5 和 Phalcon 2.0.8 在 PHP 5.5 上运行。
我有一个重写规则(使用从 Phalcon 导入的基本 .htaccess 文件)并且重写工作正常。但是,我在重写模块中创建了一个名为 APPLICATION_ENV 的系统变量,并将其附加到重写,值为 staging。
如果我查看 /public 的主索引以外的任何页面,则该值有效 - 登台被正确拉入。但是,在索引上,它不应用该值。为什么?
编辑:这是我当前的 web.config 文件,其中包含所有内容。
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" patternSyntax="ECMAScript" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="index.php?_url=/{R:1}" appendQueryString="true" />
<serverVariables>
<set name="APPLICATION_ENV" value="staging" />
</serverVariables>
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
【问题讨论】:
-
你应该显示你的重写配置
-
这是我当前的 web.config,其中包含所有内容。编辑:添加到原始帖子。
标签: php iis url-rewriting rewrite phalcon