公用文件夹中的脚本调用index.php

时间:2012-04-27 16:36:20

标签: zend-framework .htaccess

我有用Zend Framework编写的应用程序,结构是

app/
    application/
    library/
    public/

我在公共文件夹下有一个名为test.php的php脚本。当我通过http://localhost/test.php访问它时,它也会执行index.php代码。我的.htaccess看起来像这样。

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

应该在test.php找到时停止,不是吗?

1 个答案:

答案 0 :(得分:0)

缺少favicon.ico导致调用index.php。添加favicon.ico解决了问题。