大家都好我是新来的MVC,并试图一mod_rewrite的我有麻烦当我试图加载site/about
后。我在我的Web服务器htdocs
的主根目录中有我的项目,我一直在努力去理解许多在线的教程。错误是;MVC代码点火器403错误
Forbidden
You don't have permission to access/on this server.
Additionally, a 403 Forbidden error was encountered while
trying to use an ErrorDocument to handle the request.
网站 - 控制器
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class Site extends CI_Controller {
public function index()
{
$data['title']= "Welcome Learn Guitar Online";
//$this->load->view('home',$data);
//$this->getValues();
$this->load->view("about",$data);
}
}
about.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><?php echo $title; ?></title>
</head>
<body>
<div id="container">
<h1>Welcome to about</h1>
<div id="body">
<p>hello</p>
</div>
<p class="footer">Page rendered in <strong>{elapsed_time}</strong> seconds</p>
</div>
</body>
</html>
的.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
# Removes index.php from ExpressionEngine URLs
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{REQUEST_URI} !/system/.* [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]
# Directs all EE web requests through the site index file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
个配置文件变量
$config['base_url'] = 'localhost/index.php';
$config['index_page'] = '';