简体   繁体   English

在 cpanel 下托管时,仅欢迎在 codeigniter 中加载控制器

[英]Only welcome controller loading in codeigniter when hosted under cpanel

The app which i'm creating using codeigniter is loading on my localhost.我使用 codeigniter 创建的应用程序正在我的本地主机上加载。 But when i uploaded the same into cpanel its showing " 404 Page Not Found ".但是当我将其上传到 cpanel 时,它显示“ 404 Page Not Found ”。

I'm able to access default welcome controller other than this it shows 404 page not found.我可以访问除此之外的默认欢迎控制器,它显示未找到 404 页面。

Below are my configuration in application/config/config.php下面是我在 application/config/config.php 中的配置

$config['base_url'] = '';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

.htaccess configurations are as follows .htaccess 配置如下

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?/$1 [L]

configuration in application/config/routes.php are as below application/config/routes.php 中的配置如下

$route['default_controller'] = 'login';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

If I change the default_controller to welcome then welcome is loading fine.如果我将 default_controller 更改为welcome,则welcome 加载正常。

--Thanks in advance - 提前致谢

As said in the comments : Your controller's file name must start with an uppercase.如评论中所述:您的控制器的文件名必须以大写开头。 See http://codeigniter.com/userguide3/changelog.htmlhttp://codeigniter.com/userguide3/changelog.html

Changed filenaming convention (class file names now must be Ucfirst and everything else in lowercase).更改了文件命名约定(类文件名现在必须是 Ucfirst,其他所有内容都必须是小写)。

:-) :-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM