---
title: 'CakePHP 1.2: redirect method'
url: 'https://maxwesten.nl/blog/articles/cakephp-12-redirect-method'
markdown: 'https://maxwesten.nl/blog/articles/cakephp-12-redirect-method.md'
date: '2007-04-02'
description: "Previously (in CakePHP 1.1) it was best to add an exit or return after you redirect method like: $this->redirect('controller/action'); exit(); or $this->redirect('controller/action');"
taxonomy:
  category:
    - PHP
  tag:
    - CakePHP
    - PHP
  archives_month:
    - apr_2007
  archives_year:
    - '2007'
---

# CakePHP 1.2: redirect method

[Home](https://maxwesten.nl/)  [Blog](https://maxwesten.nl/blog)  [Articles](https://maxwesten.nl/blog/articles)  CakePHP 1.2: redirect method 

## [ CakePHP 1.2: redirect method](https://maxwesten.nl/blog/articles/cakephp-12-redirect-method)

    2nd Apr 2007   [CakePHP](https://maxwesten.nl/tag:CakePHP#body-wrapper) [PHP](https://maxwesten.nl/tag:PHP#body-wrapper)  

Previously (in CakePHP 1.1) it was best to add an exit or return after you redirect method like:

```
$this->redirect('controller/action');
exit();

```

or

```
$this->redirect('controller/action');
return();

```

in CakePHP 1.2 this can be shortened to:

```
$this->redirect('controller/action', null, true);

```

See [cakebaker](http://cakebaker.42dh.com/2007/03/28/redirect-with-exit) on this too.

 [ Previous Article](https://maxwesten.nl/blog/articles/cakephp-12-html-link-with-html-or-image) [Next Article ](https://maxwesten.nl/blog/articles/nice-writeup-of-ajax-use-in-cakephp)

#### Related Posts

- 100 

     [Mod\_security settings for Wordpress 3.x](https://maxwesten.nl/blog/articles/mod_security-settings-for-wordpress-3-x "Mod_security settings for Wordpress 3.x")
- 100 

     [Developing in PHP with NetBeans 6.8](https://maxwesten.nl/blog/articles/developing-in-php-with-netbeans "Developing in PHP with NetBeans 6.8")
- 100 

     [Installing xDebug 2.0.4 or 2.1 on OSX](https://maxwesten.nl/blog/articles/installing-xdebug-204-or-21-on-osx "Installing xDebug 2.0.4 or 2.1 on OSX")
- 100 

     [Installing PHP 5.2.8 on OSX Leopard 10.5.6](https://maxwesten.nl/blog/articles/installing-php-on-osx-leopard "Installing PHP 5.2.8 on OSX Leopard 10.5.6")
- 100 

     [CakePHP site redesign for 1.2 release ?? !!](https://maxwesten.nl/blog/articles/cakephp-site-redesign-for-12-release "CakePHP site redesign for 1.2 release ?? !!")

[←](https://xn--sr8hvo.ws/%F0%9F%92%95%F0%9F%8E%89%E2%A4%B5%EF%B8%8F/previous)An IndieWeb Webring 🕸💍 [→](https://xn--sr8hvo.ws/%F0%9F%92%95%F0%9F%8E%89%E2%A4%B5%EF%B8%8F/next)

---

## Navigation

- Parent: [Articles](https://maxwesten.nl/blog/articles.md)
- Previous: [Nice writeup of Ajax use in CakePHP](https://maxwesten.nl/blog/articles/nice-writeup-of-ajax-use-in-cakephp.md)
- Next: [CakePHP 1.2: $html->link with html or image](https://maxwesten.nl/blog/articles/cakephp-12-html-link-with-html-or-image.md)
