Кодовый указатель HMVC работает на локальном сервере, но не на веб-сервере
это убивает меня
что у меня есть? Версия CI: 2.1.4 Модульные расширения - HMVC от wiredesignz - базовый проект codeigniter (hmvc), который прекрасно работает с настройками, установленными на локальном сервере (mamp) с php 5.5.3.
Моя проблема после того, как я перенес проект на общедоступный веб-сервер, я изменил следующие вещи. --application / Config / config.php
$ config ['base_url'] = 'http://example.com/«;
--application / конфигурации / database.php
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'newdbusername';
$db['default']['password'] = 'newdbpassword';
$db['default']['database'] = 'newdbname';
--public_html / .htaccess
RewriteEngine On
RewriteBase /
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#Checks to
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin
ErrorDocument 404 /index.php
Поскольку моя индексная страница будет индексной функцией «домашнего» модуля, я не затрагивал файл rout.php в папке application / config. ниже приведены настройки для router.php
$route['default_controller'] = "home";
$route['404_override'] = '';
ПРОБЛЕМА всякий раз, когда пытаются получить доступhttp://example.com/ я получаю сообщение ниже
404 Страница не найдена Запрошенная вами страница не найдена.
я получаю то же сообщение, если я пытаюсь попробовать example.com/home, но example.com/welcome по-прежнему приветствует страницу codeigniter
ЧТО ПРОИСХОДИТ!!!??? Почему я не могу получить доступ к любой из моей страницы из модулей? что я пропустил ?? кто-нибудь еще получает эту проблему ??
PS: мой cpanel имеет php 5.3.27, если это помогает
Update :: ниже - функция индексации моего контроллера по умолчанию
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Home extends MX_Controller
{
function __construct() {
parent::__construct();
}
function index()
{
$this->load->library('recaptcha');
$data['recaptcha_html'] = $this->recaptcha->recaptcha_get_html();
$data['view_file'] = "checkmember";
$this->load->module('templates');
$this->templates->checkinfo();
}
============
ОБНОВЛЕНИЕ 2<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Welcome extends CI_Controller {
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
* @see http://codeigniter.com/user_guide/general/urls.html
*/
public function index()
{
$this->load->view('welcome_message');
}
}
/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */