Welcome Guest, Not a member yet? Register   Sign In
Question about Routing
#1

[eluser]NateL[/eluser]
I'm trying to do some Facebook and Twitter type of routing where you type in example.com/username

In my routes, I have this:

Code:
$route['admin'] = 'admin';
$route['account'] = 'account';

$route['(:any)'] = "member/look_up/$1";

so if I type in http://example.com/foobar, the member controller and look_up method is called, and executes as it should.

If I type in http://example.com/account, the account page appears, but if I type in a method of my account, such as http://example.com/account/login, then my route gets messed up, it shows the member look_up method, and starts looking for a member named "account", which isn't what I'm after.

Any suggestions on how to do what I'm after? Thanks Smile
#2

[eluser]duffy0[/eluser]
The least pretty would be too define everything so you would have something like this:

Code:
$route['admin'] = 'admin';
$route['account'] = 'account';
$route['account/login'] = 'account/login';

$route['(:any)'] = "member/look_up/$1";

I haven't tried this, but this might also work:
Code:
$route['admin'] = 'admin';
$route['admin/:any'] = 'admin/$1';

$route['account'] = 'account';
$route['account/:any'] = 'account/$1';

$route['(:any)'] = "member/look_up/$1";




Theme © iAndrew 2016 - Forum software by © MyBB