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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top