I want to use username on my url, how can i ? |
[eluser]Unknown[/eluser]
hello all I am a new study of CI and I want to use username on my url like http://localhost/mywebsite/charler and make a mod rewrite to http://localhost/mywebsite/user/getuser/charler after I study how to remove index.php with create a .htaccess file like Code: RewriteEngine On so I modify a little bit to Code: RewriteEngine On It doesn't work just give me 404. Then I replace [L] with [R, L], It's work but i don't want it that way. I'm very confusing right now. I just want to know why and how I can get what I want. thanks in advance. sorry for my bad english.
[eluser]vbsaltydog[/eluser]
http://ellislab.com/codeigniter/user-gui...uting.html
[eluser]Unknown[/eluser]
wow ... Interesting It's work !!!! don't change .htaccess just change route[404] Code: $route['404_override'] = 'user/getuser'; and use Code: $this->uri->segment(1) I spent almost two days to figure it out. Thank you very much, vbsaltydog
[eluser]Aken[/eluser]
404_override is the route for what controller/method should be displayed in the event of a 404. Change this route to a specific method meant to display a 404 error. Add a new route for your usernames. |
Welcome Guest, Not a member yet? Register Sign In |