Welcome Guest, Not a member yet? Register   Sign In
Default Controller Issue
#1

[eluser]TheServant[/eluser]
I have spent the past 3 hours reading posts on these forums from people who seem to have a similar problem but no solution works. Please can someone have a look and see if you can help:
This is my controller:
Code:
class Page extends Controller {
    function Page()
    {
        parent::Controller();
    }
    function index($page='register')
    { ...
With/without any routing or mod_rewrite the address: index.php/page/index/$page works as expected.

When I use mod_rewrite:
Code:
<IfModule mod_rewrite.c>
    # Customized error messages.
    ErrorDocument 404 /index.php

    # Set the default handler.
    DirectoryIndex index.php

    # Various rewrite rules.
    RewriteEngine on
    RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>
Almost anything I type will get me the default $page in the controller. I have also tested opening another file with this mod_rewrite code and it works for that, just not CI.
/ -> Default
/page -> Default
/page/ -> Default
/page/index -> Default
/page/index/ -> Default
/page/index/home -> Default
/page/index/asdasd -> Default

I have changed my $config['uri_protocol'] to all of the options with no solution.

My $route['default_controller'] = "page";

I have added another route: $route[':any'] = 'page/index';
With variations:
$route[':any'] = 'page';
$route[':any'] = 'page/';
$route[':any'] = 'page/index';
$route[':any'] = 'page/index/';
$route[':any'] = 'page/index/$1';
$route['(:any)'] = 'page/index/$1';
All resulting in the Default.

I think that some override is happening with the default_controller that it either serves that or nothing (404). I can't run other classes even if I try:
index.php/test/index/test (and all the variations) as it continually returns the default from the class defined in the default controller.

Any help would be greatly appreciated. This has brought me to utter exhaustion and all the time CI has saved me has been lost Sad


Messages In This Thread
Default Controller Issue - by El Forum - 04-14-2010, 08:14 AM
Default Controller Issue - by El Forum - 04-14-2010, 08:41 AM
Default Controller Issue - by El Forum - 04-14-2010, 08:43 AM
Default Controller Issue - by El Forum - 04-14-2010, 08:54 AM
Default Controller Issue - by El Forum - 04-14-2010, 09:00 AM
Default Controller Issue - by El Forum - 04-14-2010, 09:07 AM
Default Controller Issue - by El Forum - 06-28-2010, 03:07 AM
Default Controller Issue - by El Forum - 06-29-2010, 06:56 AM
Default Controller Issue - by El Forum - 06-29-2010, 04:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB