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

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -