문제

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