Questions tagged [cakephp-routing]

Routing is a feature that maps URLs to controller actions.

It was added to CakePHP to make pretty URLs more configurable and flexible. Using Apache’s mod_rewrite is not required for using routes, but it will make your address bar look much more tidy.

Routes in an application are configured in app/Config/routes.php.

Manual Reference.

Example:

Router::connect(
    '/pages/*',
    array('controller' => 'pages', 'action' => 'display')
);

This route is found in the routes.php file distributed with CakePHP. This route matches any URL starting with /pages/ and hands it to the display() action of the PagesController(); The request /pages/products would be mapped to PagesController->display('products').

46 questions
-4
votes
1 answer

CakePHP $this->redirect($this->Auth->redirectUrl()); Duplicates BaseURL in Redirect

In CakePHP v2.3.8, after a user logs in, I want to send them to the page they were trying to access. CakePHP is running out of a subdirectory (baseurl in the example below): $this->redirect($this->Auth->redirectUrl()); sends me…
Chris Voth
  • 853
  • 5
  • 13
  • 22
1 2 3
4