Cakephp:如何将我的项目 url 设置为我的域?

Cakephp : How to set my project url to my domain?

例如 http://example.com/ 是我的域名,当我访问它时,它会显示 cakephp 框架主页和五个绿色消息。 我必须输入 http://example.com/index.php/public/index 才能进入我的项目主页

我应该怎么做才能让我的项目 运行 进入我的主域 url http://example.com/

我正在使用 CakePHP 2.7.1

提前致谢

您可以在 routes.php 的配置文件夹中定义路由,如下所示

   Router::connect('/', array('controller' => 'public', 'action' => 'index'));

这会将您的主 url 重定向到所需的控制器