Zend框架URL在本地环境中不起作用


Zend framework URLs not working in local environment

我终于建立并运行了一个基本框架,但现在当我想在"IndexController.php"中添加一个操作时,它似乎不起作用。

我使用以下终端命令添加了一个"关于"操作:

zf create action about index

当我打开"IndexController.php"备份,新的操作函数就在那里时,它似乎起了作用。在"views/scripts/index"中创建了相应的"about.phtml"文件,旁边还有已经存在的"index.phtml"。

当我在访问索引时

http://localhost3:8888/

页面正确打开。

然而,如果我现在尝试访问上的关于页面

http://localhost3:8888/index/about

我得到一个"404未找到"的错误。

有什么想法吗?

看起来像是mod_rewrite问题。

尝试http://localhost3:8888/index.php/index/about。如果它有效,那么它肯定意味着mod_rewrite没有正确设置。