1

I want to create a redirect using a query string in Zend 1.12. The optional parameters should be in the form of a query string.

This is my code:

if ($this->_request->getParam('partner')){

   $controller = $this->getRequest()->getControllerName();
   $action = $this->getRequest()->getActionName();
   $module = $this->getRequest()->getModuleName();
   $params = array(
     "utm_source" => "affiliate",
     "utm_medium" => "cpa",
     "utm_term" => $this->_request->getParam('partner'),
     "utm_campaign" => "partners",
     "url" => $this->_request->getParam('url')
   );¬

   $this->_helper->redirector($action, $controller, $module, $params);
   return false;
 }
}

This produces an URL like

/content/agb/utm_source/affiliate/utm_medium/cpa/utm_term/foo

However I want this to look like:

/content/agb?utm_source=affiliate&utm_medium=cpa&utm_term=foo

How could I do that?

Thanks!

1 Answer 1

1

I've had better success with building the URL myself and using gotoUrlAndExit()

$this->_helper->redirector->gotoUrlAndExit('place?thing=value');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.