Question

I want to redirect user to external link. When this statement is executed:

$observer->getRequest()->setParam('return_url','http://www.google.com/');

I always get the following error:

External urls redirect to "google.com/"; denied!

Did somebody have the same issue?

Was it helpful?

Solution

Try Following in your Observer

<?php 
    Mage::app()->getResponse()->setRedirect($url)->sendResponse(); 
    // or 
    Mage::app()->getFrontController()->getResponse()->setRedirect($url)->sendResponse(); 
?>

More information you can find here and here

OTHER TIPS

You cannot redirect from php in an ajax call.

You need to send the right information back from your php script to your java script and do the redirect from there, using the parameters you got back from php.

In your ajax response you can check status of request and then you have to check if it's success then you can redirect using javacript

        window.location.href = "http://www.google.com";

Let me know if you have any query

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top