In cakephp if you want to remove controller name from URL , just add below line on your's routes.php file.
Router::connect('/:action', array('controller' => 'pages'));
its come something like that locahost/stiename/action .
We do this generally to show our static pages on site without controller name in URL , page which are likes about us ,contact us ,help and so on.
thank a lot for your help.. can you please guide how to remove controller and action both as I want yo use url
ReplyDeleteFrom
http://abc.com/controller/action/parameter
To
http://abc.com/parameter
Router::connect('aboutus', array('controller' => 'pages','action' => 'cms','aboutus'));
Deletearray('action' => '/../cms')
DeleteTry This
I have tried below method to use just parameter name, but its not working.
DeleteRouter::connect('aboutus', array('controller' => 'pages','action' => 'cms','aboutus'));
Can you please suggest another solution?