php - Codeigniter - URI Routes not working -
what current uri looks like: localhost/home/saved, localhost/home/view
what want like: localhost/saved, localhost/view.
what home controller looks like:
class home extends ci_controller { public function index() { //stuff } public function saved() { //stuff } public function view() { //stuff } } i want rid of home url user can visit localhost/saved, , other functions in home without typing home in url.
i tried putting these in routes.php file no luck.
$route['home/(:any)'] = "$1"; //that didn't work tried putting this: $route['home/(:any)'] = "/$1"; //that didn't work either. any highly appreciated. thanks!
try this
$route['saved'] = 'home/saved'; $route['view'] = 'home/view'; output -
www.example.com/saved,www.example.com/view
Comments
Post a Comment