【发布时间】:2013-01-13 12:51:11
【问题描述】:
我已经在 code igniter 上开发了一个 web 应用程序 .. 这是我第一次在 code-igniter 上工作 .. 在我的 localhost 上开发了一个 web 应用程序之后。所以我决定把我的 code-igniter web 应用程序放在临时免费服务器.. 所以我在这个网站上上传了我的网站 1freehosting... 然后我导入了我的数据库 .. 之后我在 database.php 文件中更改了数据库的设置 .. 我还更改了 config.php 文件中的基本 url .. 因为这是我的域名http://hello.hostingsiteforfree.com/... 所以我把它改成了这个 url .. 但后来我收到了以下错误...我不知道出了什么问题..我搜索了很多但没有任何帮助..我也忘记了提到我的 .htaccess 文件是空的 ..意味着里面没有一行
这是我遇到的错误
404 Page Not Found
The page you requested was not found.
routes.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';
【问题讨论】:
标签: php .htaccess codeigniter webserver hosting