【问题标题】:codeigniter page not found找不到codeigniter页面
【发布时间】:2016-08-25 00:58:53
【问题描述】:

我在 Codeigniter 中创建了项目。该项目在 localhost Wamp 中运行,但我上传的在线服务器无法正常工作

在本地主机工作网址中

http://localhost/newjob/index.php/home

但是上传到服务器后这个网址不起作用

http://example.com/index.php/home

http://example.com/

控制器

<?php class Home extends Controller {

      public function index() {

          echo "home page";

      }    } ?>

配置

$config['base_url'] = 'http://example.com/';

【问题讨论】:

  • 你的.htaccess 文件?
  • codeIgniter 中控制器或模型的末尾不需要?&gt; 确保所有文件名的首字母大写 示例stackoverflow.com/questions/34025305/…
  • class Home extends Controller 是错误的。使用class Home extends CI_Controller
  • 哪个 CodeIgniter 版本?

标签: php codeigniter url


【解决方案1】:

如果你的 home 控制器名称以 H("Home.php") 开头,请重命名为 home.php。

【讨论】:

    【解决方案2】:

    我认为http://example.com/index.php 就足够了,因为它是一个文件,文件中不能有文件夹

    【讨论】:

      猜你喜欢
      • 2020-07-14
      • 2019-12-02
      • 1970-01-01
      • 2016-11-14
      • 2015-06-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多