我正在尝试将我做的一个小应用程序上传到主机(http://fetratel.com/gestionreportev2/)但是出于某种原因,我可以在'route.php'中调用的唯一控制器是'welcome'(默认情况下) )$ route ['default_controller'] =" welcome "
)。当我把另一个驱动程序的名称没有得到它
我的配置如下:
gestionreportev2
| application
| | config
| | | config.php
| | | routes.php
| | controllers
| | | export.php
| | models
| | | exportmodel.php
| | views
| | | export
| | | | index.php
|.htaccess
的config.php
$config['base_url'] = 'http://www.fetratel.com/gestionreportev2/';
$config['index_page'] = '';
autoload.php
$autoload['libraries'] = array('database');
$autoload['helper'] = array('url', 'file');
routes.php文件
$route['default_controller'] = "export";
$route['404_override'] = '';
的.htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
控制器:
export.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Export extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('Exportmodel','ticket');
}
public function index()
{
$title = ['title' => 'Listado a Exportar'];
$this->load->view('Header', $title);
$this->load->view('Export/Index');
$this->load->view('Foother');
}
public function ajax_list()
{
...
}
}
此应用程序配置参数数据库本地运行正常。
我提前感谢所有支持。
答案 0 :(得分:0)
使用此.htacess
RewriteEngine on
RewriteCond $1 !^(index\.php|assets|image|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]