title: Magento - Redirect Customer from Observer Method
body: <p>In this event <code>checkout_cart_add_product_complete</code>, I want the customer to be redirected to an external web page <code>http://www.example.com/</code>. For this I am using this code, which is not working at all:-</p>
  
  <pre><code>public function moduleMethod() {
      /* @var $response1 Mage_Core_Controller_Response_Http */
      $response1 = $observer-&gt;getEvent()-&gt;getResponse();
  
      /* @var $response2 Mage_Core_Controller_Response_Http */
      $response2 = Mage::app()-&gt;getResponse();
  
      $url = 'http://www.example.com/';
      $response1-&gt;setRedirect($url);
  
      return;
  }
  </code></pre>
  
  <p>I have used the "<code>setRedirect()</code>" method on both these variables "<code>$response1</code>" and "<code>$response2</code>", but both of them show me the Shopping Cart page, whereas I want to see this page <code>http://www.example.com/</code> instead.</p>
  
  <p>What I want:</p>
  
  <ul>
  <li>I don't want to override the Controller Class, just to redirect the Customer, when I can effectively use the Event Observer process.</li>
  <li>I don't want to use the PHP in-built function "<code>header()</code>", when Magento framework provides this functionality in an efficient way.</li>
  </ul>