CodeIgniter Forums
CI + HMVC Routing Issue - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: CI + HMVC Routing Issue (/thread-12035.html)

Pages: 1 2


CI + HMVC Routing Issue - El Forum - 10-03-2008

[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


CI + HMVC Routing Issue - El Forum - 10-03-2008

[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.


CI + HMVC Routing Issue - El Forum - 10-03-2008

[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).


CI + HMVC Routing Issue - El Forum - 10-03-2008

[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.


CI + HMVC Routing Issue - El Forum - 10-03-2008

[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.


CI + HMVC Routing Issue - El Forum - 10-03-2008

[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';



CI + HMVC Routing Issue - El Forum - 10-03-2008

[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. ;-)


CI + HMVC Routing Issue - El Forum - 10-03-2008

[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>



CI + HMVC Routing Issue - El Forum - 10-03-2008

[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.


CI + HMVC Routing Issue - El Forum - 10-03-2008

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