1

For example: I have a controller: "Services" and an action called "web". Thus, my url would be:

http://www.domain.com/services/web/

How do I mask the url, such that if I type:

http://www.domain.com/servicesweb

will display exactly as http://www.domain.com/services/web/

I am reading the htaccess, not sure if its a correct solution to this.

carpie
  • 13
  • 2
  • 1
    Have you read the manual chapter about [routes](http://book.cakephp.org/view/945/Routes-Configuration)? – JJJ Aug 25 '11 at 10:35
  • @Juhana: Sorry, I didnt read about that. The first thing that comes to my mind was url masking(mod_alias) when the client ask me to change. – carpie Aug 25 '11 at 10:53

1 Answers1

3

It appears you missed the entire chapter in the CakePHP docs about Routing, which is this 'url masking' you speak of.

In your /app/config/routes.php file you will need to add this line:

Router::connect('/servicesweb',  array('controller' => 'services', 'action' => 'web'));

Be sure to read the book for clarification on routing.

Dunhamzzz
  • 14,682
  • 4
  • 50
  • 74
  • Best answer. Sorry, I am new to cakephp, didnt know cakephp routing could do all this. I though I might need to use, URL masking, aliases etc – carpie Aug 25 '11 at 10:52