【发布时间】:2019-01-05 01:38:18
【问题描述】:
我今天使用此链接从 github 克隆了 Codeigniter 的副本:https://github.com/bcit-ci/CodeIgniter.git。我目前正在运行 MAMP 设置,以便 http://localhost:8888 指向我的 htdocs 文件夹。我的根文件夹称为“时间”。当我转到http://localhost:8888/time/index.php 时,我确实看到了 Codeigniter 欢迎页面。另外,即使根目录中没有 .htaccess 文件,我也可以访问 http://localhost:8888/time/ 并看到相同的欢迎页面。
这就是问题所在。我在 Welcome.php 控制器类中添加了以下函数:
public function test()
{
echo 'Test';
}
当我访问http://localhost:8888/time/index.php/test 时,这应该会显示一个显示“测试”的页面。但是,我收到 404 page not found 错误。有人对理解和解决这个问题有什么建议吗?
【问题讨论】:
标签: php codeigniter url-routing