I am trying to implement routing in cakephp. I want the urls to mapped like this…
http://www.example.com/nodes/main -> http://www.example.com/main
http://www.example.com/nodes/about -> http://www.example.com/about
So for this I wrote in my config/routes.php file..
Router::connect('/:action', array('controller' => 'nodes'));
Now, I got the thing going but when I click on the links, the url in browser appears like
http://www.example.com/nodes/main
http://www.example.com/nodes/about
Is there some way where I can get the urls to appear the way they are routed?
Setting in .htaccess or httpd.conf would be easy – but I don’t have access to that.
Regards
Vikram
This should work:
You may also do something more powerful, like this: