0
votes

I was wondering how to do a redirect in the routes of a cakephp application.

I simply want to redirect on url /xxx to /yyy

I don't want to have to set up a controller or and action in the pages controller just to redirect a url.

Is there a way to do it in the routing?

Cheers.

3
I think you can do this simply in the .htaccess file, don't you?Nik Chankov

3 Answers

2
votes

Routes are used to connect URLs to controller actions. That's all they do. They do not redirect.

As @Nik suggested, if you don't want to make a controller for it, use .htaccess rules.

0
votes

@smickie, its not rails, the proper way to do it is use Controller::beforeRedirect() look it up in the api for the params that it uses.