HMVC Codeigniter在本地服务器上有效,但在Web服务器上无效

这杀了我

我有什么?CI版本:2.1.4模块化扩展-Wiredesignz的HMVC是一个基本的codeigniter(hmvc)项目,该项目可以很好地与php 5.5.3在本地服务器(mamp)中的设置一起使用

将项目移至公共Web服务器后出现的问题是我更改了以下内容。——application / config / config.php

$ config ['base_url'] =' http://example.com/ ';

——application / config / 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

由于我的索引页面将是“主页”模块的索引功能,因此我没有触摸application / config文件夹中的routes.php文件。以下是routes.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如果有帮助

更新::下面是我默认的控制器的索引函数

<?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 */

终于解决了问题。这是我在modules文件夹中的文件夹结构。

—模块/

- - -/家

———————— //控制器——-> home.php

———————— /模型——-> mdl_home.php

———————— //视图——-> viewfile.php

我要做的就是更改“ Controllers”,“ Models”和“ Views”文件夹的大小写,然后我又恢复了业务。

现在文件夹结构是这样的,并且可以正常工作

—模块/

- - -/家

———————— //控制器——-> home.php

———————— /模型——-> mdl_home.php

———————— // views ——-> viewfile.php

阿什什

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

MySql连接查询在本地服务器上有效,但在实时服务器上无效

来自分类Dev

MySQL连接在Localhost上有效,但在Web服务器上无效

来自分类Dev

CodeIgniter + HMVC 错误

来自分类Dev

jQuery ajax调用在本地主机上有效,但在实时服务器上无效

来自分类Dev

@ font-face在本地服务器上有效,但在生产服务器上无效-如何调试?

来自分类Dev

@ font-face在本地服务器上有效,但在生产服务器上无效-如何调试?

来自分类Dev

令牌解密RSA在localhost上有效,但在服务器上无效

来自分类Dev

CodeIgniter HMVC加载模块操作

来自分类Dev

强制 Codeigniter HMVC 使用 SSL

来自分类Dev

为什么此代码在我的测试服务器上有效,但在jsfiddle上无效?

来自分类Dev

htaccess规则在一个服务器上有效,但在另一台服务器上无效

来自分类Dev

Vaadin上传在localhost上有效,但在服务器上失败

来自分类Dev

Laravel HMVC路由到控制器

来自分类Dev

phantomjs page.evaluate从http://www.google.com/search?q=site刮取“ resultStats”:%s在本地服务器上有效,但在生产服务器上无效

来自分类Dev

在Codeigniter hmvc中加载模型时出错

来自分类Dev

无法从CodeIgniter HMVC中的库加载模块

来自分类Dev

验证不适用于HMVC Codeigniter

来自分类Dev

CodeIgniter模板和其他模块(HMVC?)

来自分类Dev

流星软件包在浏览器上有效,但在服务器上不可用

来自分类Dev

从WCF客户端连接到服务器的问题-HTTPS终结点-在本地Dev上有效,但在服务器上不起作用

来自分类Dev

laravel ajax呼叫发布/输入给出500/404内部服务器错误,但在本地服务器上有效

来自分类Dev

Codeigniter hmvc和主控制器,模型和视图

来自分类Dev

带有多行修饰符的正则表达式在服务器上有效,但在xampp localhost上无效

来自分类Dev

带多行修饰符的正则表达式在服务器上有效,但在xampp localhost上无效

来自分类Dev

HTML5 AppCache:应用程序缓存在开发服务器上有效,但在IIS 7.5上无效

来自分类Dev

CodeIgniter 3上的HMVC无法正常工作-获取404

来自分类Dev

如何使用 hmvc codeigniter 在 mbile 上加载引导程序?

来自分类Dev

自定义页面布局仅在本地服务器上有效

来自分类Dev

为什么Windows身份验证在本地到服务器而不在服务器到服务器上有效?

Related 相关文章

  1. 1

    MySql连接查询在本地服务器上有效,但在实时服务器上无效

  2. 2

    MySQL连接在Localhost上有效,但在Web服务器上无效

  3. 3

    CodeIgniter + HMVC 错误

  4. 4

    jQuery ajax调用在本地主机上有效,但在实时服务器上无效

  5. 5

    @ font-face在本地服务器上有效,但在生产服务器上无效-如何调试?

  6. 6

    @ font-face在本地服务器上有效,但在生产服务器上无效-如何调试?

  7. 7

    令牌解密RSA在localhost上有效,但在服务器上无效

  8. 8

    CodeIgniter HMVC加载模块操作

  9. 9

    强制 Codeigniter HMVC 使用 SSL

  10. 10

    为什么此代码在我的测试服务器上有效,但在jsfiddle上无效?

  11. 11

    htaccess规则在一个服务器上有效,但在另一台服务器上无效

  12. 12

    Vaadin上传在localhost上有效,但在服务器上失败

  13. 13

    Laravel HMVC路由到控制器

  14. 14

    phantomjs page.evaluate从http://www.google.com/search?q=site刮取“ resultStats”:%s在本地服务器上有效,但在生产服务器上无效

  15. 15

    在Codeigniter hmvc中加载模型时出错

  16. 16

    无法从CodeIgniter HMVC中的库加载模块

  17. 17

    验证不适用于HMVC Codeigniter

  18. 18

    CodeIgniter模板和其他模块(HMVC?)

  19. 19

    流星软件包在浏览器上有效,但在服务器上不可用

  20. 20

    从WCF客户端连接到服务器的问题-HTTPS终结点-在本地Dev上有效,但在服务器上不起作用

  21. 21

    laravel ajax呼叫发布/输入给出500/404内部服务器错误,但在本地服务器上有效

  22. 22

    Codeigniter hmvc和主控制器,模型和视图

  23. 23

    带有多行修饰符的正则表达式在服务器上有效,但在xampp localhost上无效

  24. 24

    带多行修饰符的正则表达式在服务器上有效,但在xampp localhost上无效

  25. 25

    HTML5 AppCache:应用程序缓存在开发服务器上有效,但在IIS 7.5上无效

  26. 26

    CodeIgniter 3上的HMVC无法正常工作-获取404

  27. 27

    如何使用 hmvc codeigniter 在 mbile 上加载引导程序?

  28. 28

    自定义页面布局仅在本地服务器上有效

  29. 29

    为什么Windows身份验证在本地到服务器而不在服务器到服务器上有效?

热门标签

归档