Remove controller name from url

[eluser]Matthew Pennell[/eluser]
[quote author="Giacomo" date="1191163399"][quote author="Buddy Bradley" date="1191151815"]
$routes['([a-z\_]+)$'] = "welcome/$1";
Just another question: what about if i want to match all except one string?

I tried with:
$routes['([a-z\_]+)^string$'] = "welcome/$1";
But it doesn't work.[/quote]
I can't remember how to do negation in regular expressions, and my cribsheet is at work. The easiest thing to do would be to set up a more specific route that matched the exception:
$routes['^string$'] = "welcome/specific_method";
$routes['([a-z\_]+)$'] = "welcome/$1";

the first one doesnt even need to be regex, routes don't overwrite each other so what ever "applies" first will be used

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.