笨路由返回“找不到文件”搬住服务器
在我的根目录后,我的.htaccess:笨路由返回“找不到文件”搬住服务器
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
从URL中删除index.php文件。
在我的routes.php文件的文件我有:
$route['default_controller'] = 'absolventi';
$route['absolventi'] = 'absolventi';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
默认控制器的工作原理,但添加/ absolventi域没有。每个请求的文件都没有找到文件。另外ajax调用返回。
我试图更改为$route['absolventi'] = 'index.php/absolventi';
以查看.htaccess是否覆盖index.php,但仍然是相同的错误。真的不知道还有什么要做。任何帮助,建议将不胜感激。如果需要更多信息,请询问。
,如果这是你的控制器的名字absolventi
然后按照这个
文件名应该是Absolventi.php
和文件
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Absolventi extends CI_Controller {
public function __construct()
{
parent::__construct();
}
在你的项目这样做对所有的文件里面。 我们把这个作为命名转换
我有一切OK与命名转换!如果有问题,CI返回404页面。当调用base_controller时,控制器“absolventi”完美工作。 –
基URL也应该指向 –
对不起,不是作为base_controller而是作为default_controller。这个想法是控制器工作,有路由问题。 –
是启用了mod_rewrite? – qwertzman