• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
URI /

#1
[eluser]MMCCQQ[/eluser]
hi!

how can i do this?
URL http:/domain.com/username
/main/ index/ username
Class Controller URI Segment
So.

http://domain.com/username/add_article

main/add_article
Class / Controller

i got this

$route['(:any)'] = "main/index/$1";
$route['(:any)/(:any)'] = 'main/$2' ;

its the best solution??

#2
[eluser]xwero[/eluser]
You going to have to switch the routes because in your example you are never going to reach the second route. The rule for adding routes is first comes first served.

#3
[eluser]MMCCQQ[/eluser]
how can i do it?

#4
[eluser]xwero[/eluser]
Code:
$route[’(:any)/(:any)’] = ‘main/$2’ ; // http://domain.com/username/add_article
$route[’(:any)’] = “main/index/$1”; // http://domain.com/username


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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