我在 code-igniter 上开发了一个 Web 应用程序..这是我第一次在 code-igniter 上工作..在我的本地主机上开发了一个 Web 应用程序后。所以我决定将我的 code-igniter Web 应用程序放在临时免费服务器上..所以我在这个网站上上传了我的网站1免费托管 http://www.1freehosting.com/...然后我导入了我的数据库..之后我更改了database.php文件中的数据库设置..并且我还更改了config.php文件中的基本url..因为这是我的域名http://hello.hostingsiteforfree.com/ http://hello.hostingsiteforfree.com/...所以我将其更改为这个网址..但随后我收到以下错误...我不知道出了什么问题..我搜索了很多但没有任何帮助..而且我还忘记提及这一点我的 .htaccess 文件是空的..意味着里面没有一行
这是我收到的错误
404 Page Not Found
The page you requested was not found.
路线.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$route['default_controller'] = "loginController";
$route['404_override'] = '';
/* Location: ./application/config/routes.php */
我的控制器
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
类 LoginController 扩展 CI_Controller {
function index(){
$new['main_content'] = 'loginView';
$this->load->view('loginTemplate/template', $new);
}
function verifyUser(){
//getting parameters from view
$data = array(
'username' => $this->input->post('username'),
'password' => $this->input->post('password')
);
$this->load->model('loginModel');
$query = $this->loginModel->validate($data);
if ($query){ //if the user c validated
//data variable is created becx we want to put username in session
$data = array(
'username' => $this->input->post('username'),
'is_logged_in' => true
);
$this->session->set_userdata($data);
redirect('sessionController/dashboard_area');
}
else
{
$this->index();
}
}
function logout()
{
$this->session->sess_destroy();
$this->index();
}
}
?>
配置文件
$config['base_url'] = 'http://hello.hostingsiteforfree.com/';
$config['index_page'] = 'index.php';