0

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 Answers 2

2

If you have

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

You should go to

/

What is not working?

Sign up to request clarification or add additional context in comments.

Comments

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

1 Comment

Excellent! If this answer is the correct one, please set this answer as your accepted answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.