domain.com/$id or $username or w/e [solved] |
[eluser]DADE[/eluser]
Hello, I have a problem: Well. I need someting like this: When someone enters http://example.com/, he sees welcome page or w/e. It's easy. Code: function index() But when someone enters http://example.com/Username, I need to load different page, witch shows info about user or w/e. I tried something like: Code: function index() But of course it's not work. So question is: How I can load http://example.com and get welcome.php page, and how I can load http://example.com/username and get profile.php page? I saw something about routes but I don't really understand something. :\ Maybe somebody write detailed information. Thanks.
[eluser]Clooner[/eluser]
See the very detailed user guide! http://ellislab.com/codeigniter/user-gui...uting.html
[eluser]DADE[/eluser]
Yes, and I need Code: $route[':any'] = "users/profile/$1"; Boom: Idea runs through my brain. Maybe if I'll write other routes all will be fine. Like: Code: $route[':any'] = "user/profile/$1"; I'll try and write back about result
[eluser]Clooner[/eluser]
[quote author="DADE" date="1283260423"]Yes, and I need Code: $route[':any'] = "users/profile/$1"; Boom: Idea runs through my brain. Maybe if I'll write other routes all will be fine. Like: Code: $route[':any'] = "user/profile/$1"; I'll try and write back about result [/quote] Again it's all in the manual! [quote author="From the manual" date="1283260423"] Note: Routes will run in the order they are defined. Higher routes will always take precedence over lower ones. [/quote] It explains everything you want, just read and try it out!
|
Welcome Guest, Not a member yet? Register Sign In |