how to make URL friendly like http://mywebsite/username |
[eluser]CroNiX[/eluser]
Code: $route['(:any)'] = 'users/viewprofile/$1'; Then in users, your viewprofile should look like Code: public function viewprofile($username = '') //$username is being passed as the $1 in the route
[eluser]Linh Pham[/eluser]
[quote author="CroNiX" date="1334282323"] Code: $route['(:any)'] = 'users/viewprofile/$1'; Then in users, your viewprofile should look like Code: public function viewprofile($username = '') //$username is being passed as the $1 in the route your way it works but occur a problem : my login page : http://domainname.com/users/login , type this url onto address, it calls method viewprofile, cant access to login page a few pages like that
[eluser]Linh Pham[/eluser]
[quote author="Linh Pham" date="1334282907"][quote author="CroNiX" date="1334282323"] Code: $route['(:any)'] = 'users/viewprofile/$1'; Then in users, your viewprofile should look like Code: public function viewprofile($username = '') //$username is being passed as the $1 in the route your way it works but occur a problem : my login page : http://domainname.com/users/login , type this url onto address, it calls method viewprofile, cant access to login page a few pages like that[/quote] oh i do this $route['users/login'] = "users/login"; and i works fine thank you for supporting me
[eluser]Mantero[/eluser]
this is call Vanity URL here's the solution http://ellislab.com/forums/viewthread/139195/#685983 |
Welcome Guest, Not a member yet? Register Sign In |