I have two function "product" and "view" in cakephp. If any one type domainname.com/item1 then call "product" function and if domainname.com/item1/item2 then call "view" function .
item1 and item2 is dynamic content.
Router::connect('/:category', array('controller' => 'Posts', 'action' => 'product')); Router::connect('/:category/:title', array('controller' => 'Posts', 'action' => 'view'));
I use this code in routes.php
Problem is this if I enter domainname.com/item1 then it is call view function.
please suggest me how to use url rewriting in cakephp .
Problem is this if I enter domainname.com/item1 then it is call view function.
- are you sure about that? The above routes do not match that behavior (demonstrate it). – AD7six