我的htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
我的控制器
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Auth extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->library('form_validation');
}
public function index()
{
$this->form_validation->set_rules('username', 'Email', 'required|trim');
$this->form_validation->set_rules('password', 'Email', 'required|trim');
if ($this->form_validation->run() == FALSE) {
# code...
$data['title'] = 'Login';
$this->load->view('templates/auth_header', $data);
$this->load->view('auth/login');
$this->load->view('templates/auth_footer');
} else {
$this->_login();
}
}
有人知道我的问题吗?我认为我的语法是正确的,但页面仍然没有找到。有人帮助我吗,我仍然是一个初学者在该领域的程序员
3条答案
按热度按时间9fkzdhlc1#
请将此htaccess文件添加到应用程序文件夹中。它可能会有所帮助
您的htaccess文件在应用程序文件夹之外。这也是必需的。
uqdfh47h2#
kg7wmglp3#
请将文件名更改为(auth/Login)首字母大写