Welcome Guest, Not a member yet? Register   Sign In
Default_controller in routes.php changed but nothing happens
#1

[eluser]ErwinVanHoof[/eluser]
Can someone help me out.
I'm having the following problem

I changed
-system
-application
-config
routes.php | Line 43
Code:
$route['default_controller'] = "welcome";
to
Code:
$route['default_controller'] = "pages";

created the pages.php in
-system
-application
-controllers
Code:
<?php

class Pages extends Controller {

    function Pages  ()
    {
        parent::Controller();
    }
    
    function index()
    {
        die('here');
    }

}

?>

but this does not seem to work, it works obly when I type the complete url http://localhost/pages/

Using CI 1.6.2 on a WAMP server 2 | Apache 2.0.63 | PHP 4.4.8

Could this be a caching problem ?
#2

[eluser]xwero[/eluser]
Pags instead of Pages, or is that a typing error on the forum?
#3

[eluser]ErwinVanHoof[/eluser]
Pages it is, sorry I typed pags on the forum, changed the post.
#4

[eluser]sophistry[/eluser]
do you have any other routing?
#5

[eluser]ErwinVanHoof[/eluser]
Yes, all routings work fine except the default 'changed' one.
#6

[eluser]sophistry[/eluser]
so you have other routings. are they all listed AFTER the default ones? that can cause a problem if the custom ones are before the default and scaffolding ones.
#7

[eluser]ErwinVanHoof[/eluser]
I found the problem (and fixed it). I was working in an alias (on apache) for testing purposes and the url rewrite in the .htaccess was pointing to the root directory of the site (where also CI is running) and that was why I kept seeing the welcome page.

Anyway, thnx for the help.




Theme © iAndrew 2016 - Forum software by © MyBB