0
votes

How can I remove the action name from the Url in cakephp? I tried to do it from routes.php but not getting succed my url is: http://www.example.com/liberty_new/users/home

In routes.php I have done

Router::connect('/', array('controller' => 'users', 'action' => 'home'));

I would like to remove action name from the url and like to set only the parameter in url. if I use $this->redirect(array('controller'=>'users','action'=>'home','parm1',param2));

in this redirection Url will look like

http://www.example.com/users/home/param1/param2 but I want url look like

http://www.example.com/users/param1/param2

where "users" is my controller name
please suggest me the solution

2

2 Answers

1
votes
Router::connect('/', array('controller' => 'users', 'action' => 'home'));
Router::connect('/users/*', array('controller' => 'users', 'action' => 'home'));
2
votes

If you have

Router::connect('/', array('controller' => 'users', 'action' => 'home'));

You should go to

/

What is not working?