【发布时间】:2010-10-12 06:20:54
【问题描述】:
我的 Zend Framework 应用程序出现异常行为。
我运行这个 url,希望让索引控制器运行 1234567890 动作。
http://hello.com/index/1234567890?test=http%3A%2F%2Fworld.com%2Findex.php
但是我得到这样的异常:
Message: Invalid controller specified (4567890)
奇怪的是,页面上的所有 URL 现在都链接到:
http://hello.com/index.php/index/1234567890
代替:
http://hello.com/index/1234567890
请注意,错误注入到 URL 中的 index.php 字符串有 9 个字符,它与 index/1234567890 字符串的数字相同,以获取错误的控制器名称。
另一件事是注入的 index.php 与示例中的 url 编码获取参数中的 index.php 相关。
怎么了?它是 Zend 中的错误吗?还是我做错了什么?
这是我的 .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]
【问题讨论】:
-
尝试启用mod_rewrite的日志功能(见RewriteLogLebel指令)。
标签: zend-framework mod-rewrite routing