Welcome Guest, Not a member yet? Register   Sign In
A route seems to fail and thus 404
#1

[eluser]coldclimate[/eluser]
This one is driving me up the wall!

What should happen is when a use hits http://site.com/first/theirusername CI should fire up the First controller, and call the doIt function, passing in "theirusername" as the $eventName variable. Lots of other routes+controllers are working just fine, but this one dies.

When I look in the logs I keep getting ...,
Code:
DEBUG - 2010-09-27 14:15:28 --> Controller Class Initialized
ERROR - 2010-09-27 14:15:28 --> 404 Page Not Found --> first/ab

Here's all the key bits..

controllers/first.php
Code:
<?php

class First extends Controller {

    function First()
    {
        parent::Controller();

    }
    
    function index(){
        //boot them out, somethings going on
    }
    
    function doIt($eventName){
        if (!empty($eventName)){
        //do some exciting stuff
        }else{
            //boot them out, something's going on
        }
        
    }

routes.php

Code:
$route['default_controller'] = "home";
$route['scaffolding_trigger'] = "";

$route['first/[:any]'] = "first/doIt/$1";

.htaccess means everything is hitting index.php fine, and routes working else where. What am I missing?
#2

[eluser]Dennis Rasmussen[/eluser]
Code:
$route['first/(:any)'] = "first/doIt/$1";
#3

[eluser]coldclimate[/eluser]
Dennis you are a freakin' star! Couldn't see the ( for the ['s.

How do I digitally send you Lasagne? I've been staring at that for over an hour.
#4

[eluser]Dennis Rasmussen[/eluser]
[] is used for expressions while () is used to retrieve the data within.

Glad I could help Smile




Theme © iAndrew 2016 - Forum software by © MyBB