views:

26

answers:

2

Wildcards are cool.

I am trying to do this:

$route["(:any)/controller"] = "controller";

basically, I want to put the wildcard in the front. It doesn't quite work, and I don't know any work around.

A: 

Should work. If it doesn't try shuffling around your route definitions to put the wildcard line at the end.

Also I don't think you need the parenthesis around :any.

kitsched
A: 

using regular expressions did the trick.. thank you for pointing out (:any) is greedy!

$route['([a-z_A-Z]+)/controller'] = 'controller';
tpae