我正在尝试设置代码点火器。 目录结构为
- 应用
- 系统
- public_html
由于应用程序和系统不在public_html我在public_html/index.php
内设置变量
$system_path = '../system';
和
$application_folder = '../application';
同样在应用程序/配置/路由中,默认控制器设置为我的家庭控制器
$route['default_controller'] = "home";
现在,当我指向www.mysite.com/index.php
控制器时,它会正确返回视图(从我的默认主控制器),但我无法使用www.mysite.com/home
访问此视图
为什么?
您需要
修改htaccess文件以去除索引.php以便能够在www.mysite.com/home
访问它。您还需要在配置文件中将 index_page 的值设置为 ''。
查看有关 URL 的 CodeIgniter 文档,了解如何执行此操作的示例。