【问题标题】:Problems transfering codeigniter 3.0 from localhost to live server hostgator将 codeigniter 3.0 从 localhost 传输到实时服务器 hostgator 时出现问题
【发布时间】:2015-08-05 10:57:21
【问题描述】:

尝试将 codeigniter 3.0 从 localhost 传输到 hostgator 的实时服务器时,我得到一个 404 页面。这是我的配置文件中的数据,.htaccess 和 index.php。

结构:

  • 应用
  • 系统
  • index.php
  • .htaccess

我的配置文件

$config['base_url'] = 'http://mysyite/';

$config['index_page'] = '';

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

$config['url_suffix'] = '';

$config['language'] = 'english';

$config['charset'] = 'UTF-8';

$config['enable_hooks'] = FALSE;

$config['subclass_prefix'] = 'MY_';

$config['composer_autoload'] = FALSE;

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';

$config['allow_get_array']      = TRUE;
$config['enable_query_strings'] = FALSE;
$config['controller_trigger']   = 'c';
$config['function_trigger']     = 'm';
$config['directory_trigger']    = 'd'; // experimental not currently in use

$config['log_threshold'] = 4;

$config['log_path'] = '';

$config['cache_path'] = '';

$config['rewrite_short_tags'] = FALSE; 

.htaccess

<IfModule mod_rewrite.c>

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

</IfModule>

index.php

$system_path = 'system';

$application_folder = 'application';

【问题讨论】:

    标签: php apache .htaccess codeigniter


    【解决方案1】:

    确保所有控制器和模型文件名都以大写字母开头。

    从 CodeIgniter 3.0 开始,所有类文件名(库、 驱动程序、控制器和模型)必须以 Ucfirst-like 命名 方式或换句话说 - 它们必须以大写字母开头

    来源:http://www.codeigniter.com/userguide3/installation/upgrade_300.html#step-2-update-your-classes-file-names

    【讨论】:

    • 文件或类,我从来没有得到那个......或两者兼而有之?
    • 是的,制作这些大写字母是一个令人讨厌的最小问题。我很高兴你让它工作
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-08
    • 2011-02-09
    • 2021-03-12
    • 1970-01-01
    相关资源
    最近更新 更多