CodeIgniter Forums

Full Version: CI + HMVC Routing Issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2

El Forum

[eluser]jtkendall[/eluser]
Hi, I've got CI + HMVC working locally on both a Mac and a Windows machine, however when I upload the files to a server the modules don't load. I've tried on two VPS machines and a Dreamhost account. The only error I'm getting on the servers are:

Code:
ERROR - 2008-10-03 03:08:18 --> 404 Page Not Found --> pages

Pages is a module setup with MVC folders. Since I have it working on two local machines I'm thinking there is a configuration issue on the servers (the VPS's are at the same company, so they should be exactly the same).

Does anyone have any ideas what might be causing the modules to not load? I need to get this project launched ASAP so any help or thoughts would be appreciated.

Thanks

El Forum

[eluser]wiredesignz[/eluser]
This is most likely is due to the $config['uri_protocol'] setting and/or your .htaccess setup (if used).

There are many forum posts about setting up CI on a Dreamhost account.

Good luck.

El Forum

[eluser]jtkendall[/eluser]
Hi, I tried adjusting the URI protocol and htaccess with not luck still. I'm requiring and extending a super controller (in application/controllers).

The top of my module's controller looks like this:

Code:
<?php

    require_once(APPPATH.'/controllers/super.php');

    class Pages extends Super
    {

        /**
         * Just the constructor method
         *
         * @return
         */
        public function __construct()
        {
            parent::__construct();
            $this->load->model('pages_model');
            $this->load->helper('recursion');
            $this->load->library('treeview');
        }

So I require my super controller and then extend it and I'm thinking it's more of an issue with the actual server config (PHP install) and not the code. I have other CI apps running on the same servers with the same htaccess and config setup (just not HMVC).

El Forum

[eluser]jtkendall[/eluser]
I've decided to stop using HMVC for now and just move everything back to CI's MVC folders. Will have to figure this out when I have time and no deadline.

El Forum

[eluser]sophistry[/eluser]
sounds like you found a workaround.... but, posting your routes would help... right after wired's suggestions about uri_protocol and htaccess, routes is the next place to look for problems when you get unexpected 404s.

cheers.

El Forum

[eluser]jtkendall[/eluser]
Though i found a workaround, I'd love to know what's wrong so I can undo the workaround and make this system modular again.

My routes are simple. I only have two defined because the others are linked directly.

Code:
$route['pages/(:num)']        = 'pages/index/$1';
$route['users']            = 'user_manager/management';

El Forum

[eluser]sophistry[/eluser]
and when you say you "adjusted" uri_protocol, that means you tried every variation listed as an option in the config.php file?

and htaccess, what does that look like...?

what i am getting at is, post code. ;-)

El Forum

[eluser]jtkendall[/eluser]
Sorry about that. Yes the "adjusted" uri_protocol means I tried every variant, most caused the system send the user back to a login screen regardless of what they wanted to do. The only one that worked was PATH_INFO and AUTO (which should be using PATH_INFO).

.htaccess
Code:
Options +FollowSymLinks
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
    RewriteCond %{HTTP_HOST} ^www\.(.8)$
    RewriteRULE (.*) http://%1/$1 [R=301,L]
</IfModule>
<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule>

El Forum

[eluser]wiredesignz[/eluser]
Try RewriteRule ^(.*)$ index.php?$1 [L]

Another point to note is Linux filenames and directory names are case-sensitive, whereas Windows and Mac are not.

You did say your app worked on Windows and Mac but not your server so it's worth checking everything again.

El Forum

[eluser]jtkendall[/eluser]
Nope, still getting a 404 when trying to access a module. :/
Pages: 1 2