【发布时间】:2015-11-04 11:21:31
【问题描述】:
我正在尝试访问 CodeIgniter 控制器,但遇到 404 错误。
在我的电脑里,我可以访问.../index.php/apadrinhamentoController/padrinhosPossiveis
但是当上传到服务器时,我只能访问索引文件,在
site.com/apadrinhamento/index.php 而不是 site.com/apadrinhamento/index.php/apadrinhamentoController(得到 404 错误)。
apadrinhamentoController.php文件
<?php
class apadrinhamentoController extends CI_Controller{
public function __construct() {
parent::__construct();
$this->load->helper('url');
}
public function index() {
$this->load->view('apadrinhamento');
}
}
index.php 文件是 CodeIgniter 的默认文件
我没有在/apadrinhamento 上使用.htaccess
【问题讨论】:
-
你在路由中做了哪些必要的设置,配置文件你会为此发布代码
-
绝对可以是您没有向我们展示的任何内容。
index.php文件通常位于 www 根目录中,而不是子目录中。您的.htaccess文件中有什么内容?你的config.php文件呢?index.php文件中的各种设置?到目前为止,您自己尝试过什么来解决这个问题? -
index.php 文件是 CodeIgniter 的默认文件...我没有在这个文件夹上使用 .htaccess 文件
-
那是不可能的。如果不为您的特定安装配置几行代码,默认的
index.php将无法工作。文档中对此进行了说明。 -
我在根目录中安装了 wordpress,在子文件夹中安装了 codeigniter ...
标签: php codeigniter http-status-code-404