0

I've got an application which seems to be stuck in a redirect loop when I put it in a subdirectory of my server (e.g. blah.com/testing/ instead of blah.com/), despite sharing the same code. I think I've handled the redirection stuff incorrectly, but Apache's debugging output doesn't actually list the redirections, because they're being handled inside PHP.

Is there an easy way to attach a logger to the redirection function?

Billy ONeal
  • 104,103
  • 58
  • 317
  • 552
  • if you are using redirect helper of zf not 'forward' then you can see all kind of redirects taking place from firebug NET panel in firefox. – Mr Coder Sep 12 '11 at 16:49

1 Answers1

1
class My_Controller_Action_Helper_Redirector extends Zend_Controller_Action_Helper_Redirector
{
    protected function _redirect($url)
    {
        $this->myPrettyLoggingFunction();
        parent::_redirect($url);
    }
}

if My_ namespace configured right, this plugin will be loaded by PluginLoader instead of default Zend_Controller_Action_Helper_Redirector

usage - standard way $this->_helper->redirector(...)

Billy ONeal
  • 104,103
  • 58
  • 317
  • 552
SMka
  • 3,021
  • 18
  • 14