HOW TO CREATE URL AFTER DOMAIN AS USERNAME LIKE www.example.com/username |
[eluser]johanriyan[/eluser]
hello guys, i want to create url like this : www.example.com/username how to handle controller, model and view. thks guys
[eluser]plain jane[/eluser]
You mean to say you want to remove index.php from the URL?
[eluser]johanriyan[/eluser]
thks for respons. but this problem has solved it. i use routes like this : Code: $route['user/(:any)'] = "user/view";
[eluser]sv3tli0[/eluser]
Code: $route['(:any)'] = "user/view/$1"; How ever there is one big problem when you want to put such (:any) route.. You lose all normal routes ( /controller/method ) because all are going to user/view.. So you need to write in as routes all pages your site has before that :any.. It may be easier if you set a few type of pages with prefix forbidden for username .. So "/settings" will load all settings page and etc.. This is the same way as Facebook routes work.
|
Welcome Guest, Not a member yet? Register Sign In |