我在本地服务器上配置了新的CodeIgniter副本并且运行正常。但是当我在http://subdomain.mydomain.com上传时,它显示错误。
An Error Was Encountered Unable to determine what should be displayed. A default route has not been specified in the routing file.
我的托管服务提供商是否有问题,或者我可以使用.htacess文件修复此问题?
我不知道我在处理什么。 任何帮助表示赞赏。
error_log [28-Apr-2015 19:53:56 America/New_York] PHP Warning: PHP Startup: > Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/timezonedb.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/timezonedb.so: cannot open shared object file: No such file or directory in Unknown on line 0
谢谢
答案 0 :(得分:0)
注意:可以在本地Web服务器上运行并不总是在真实服务器上成功运行。 在codeigniter 3中,您必须使用区分大小写的代码并在每个类中使用Capital Every Word。
htaccess的
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
CONFIG
$config['base_url'] = 'http://heloo.cmsapp.com/';
$config['index_page'] = "";
ROUTING
<?php defined('BASEPATH') OR exit('No direct script access allowed');
$route['default_controller'] = "Page_controller/home";
$route['page/contact'] = "Page_controller/contact";
CONTROLLER
<?php defined('BASEPATH') OR exit('No direct script access allowed');
class Page_controller extends CI_Controller {
public function __construct() {
parent::__construct();
}
public function home() {
//load your home page
}
public function contact() {
//load your contact page
}
}
阅读本文档: www.codeigniter.com/user_guide/general/styleguide.html