【问题标题】:Zend Framework on IIS6 with ISAPI RewriteIIS6 上的 Zend 框架与 ISAPI 重写
【发布时间】:2011-08-17 15:48:20
【问题描述】:

我正在尝试将 zend 应用程序从 Apache2 移动到 IIS6,因此我决定按照推荐的 here 安装 ISAPI Rewrite 3,因此我将洞应用程序文件夹复制到 c:\inetpub\wwwroot\ 并制作了 IIS默认网站指向文件夹/public。

现在,按照here 的建议,我在 /public 中的 .htaccess 如下所示。

RewriteRule (?!\.(js|ico|gif|jpg|png|css|swf))$ index.php

但是什么也没有发生,我可以正常访问主页,也可以访问静态文件,但是没有对我的 URL 进行重写,所以我的控制器都不起作用。有什么想法吗?谢谢!

【问题讨论】:

    标签: zend-framework iis iis-6 rewrite isapi-rewrite


    【解决方案1】:

    如果您使用的是 ISAPI_Rewrite 3,那么您将需要使用 Apache 版本的规则,因为它与 Apache 兼容,即

    RewriteEngine on
    RewriteBase /
    RewriteRule !\.(js|ico|txt|gif|jpg|png|css)$ index.php
    

    或更好

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php
    

    【讨论】:

    • 感谢 Yaroslav,但问题是因为我使用的是 Lite 版本的 Isapi Rewrite,它必须在其安装目录中配置一个 conf 文件
    猜你喜欢
    • 2012-06-30
    • 2016-09-02
    • 1970-01-01
    • 1970-01-01
    • 2012-12-06
    • 1970-01-01
    • 1970-01-01
    • 2011-12-15
    • 1970-01-01
    相关资源
    最近更新 更多