带子域的 Codeigniter Dreamhost
我在 CodeIgniter 中有一个应用程序,并将其上传到子域 Dreamhost 会引发以下错误:
遇到错误 无法加载请求的文件:sitio/inicio/index.php
我已按如下方式配置我的应用程序:
config.php
$config['base_url'] = 'http://sub.domain.com/';
$config['index_page'] ='';
$config['uri_protocol'] = 'AUTO';
$config['url_suffix'] ='';
paths.php
$route['default_controller'] = "sitio/inicio";
.htaccess
RewriteEngine on
RewriteBase /home/myuser/sub.domain.com/
RewriteCond $1! ^(index\.php|public/img|public/css|public/js|public/uploads|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
inicio.php
class Inicio extends CI_Controller{
function __construct(){
parent::__construct();
}
function index(){
$this->load->view('sitio/inicio/index');
}
}
我的默认控制器位于控制器内的子文件夹中,也是我的观点,位于视图内的子文件夹。问题是什么?我尝试了论坛中的一些解决方案,但我的问题仍然存在。
谢谢。
I have an application in CodeIgniter, and upload it to a subdomain Dreamhost throws me the following error:
An Error Was Encountered
Unable to load the requested file: sitio/inicio/index.php
I have configured my application as follows:
config.php
$config['base_url'] = 'http://sub.domain.com/';
$config['index_page'] ='';
$config['uri_protocol'] = 'AUTO';
$config['url_suffix'] ='';
routes.php
$route['default_controller'] = "sitio/inicio";
.htaccess
RewriteEngine on
RewriteBase /home/myuser/sub.domain.com/
RewriteCond $1! ^(index\.php|public/img|public/css|public/js|public/uploads|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
inicio.php
class Inicio extends CI_Controller{
function __construct(){
parent::__construct();
}
function index(){
$this->load->view('sitio/inicio/index');
}
}
My default controller is in a subfolder inside controllers, also my view, is in a subfolder inside views. What is the problem? I have tried with some solutions that are in the forum but my problem persists.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将默认路由指向控制器
sitio
和函数inicio
。如果您想将默认路由指向inicio
,请删除sitio
$route['default_controller'] = "sitio/inicio";
You're pointing your default route to controller
sitio
and functioninicio
. If you want to point your default route toinicio
removesitio
$route['default_controller'] = "sitio/inicio";