Redirect causing browser to hang

Hi all,

This might be an interesting issue. Recently I had to move my application to a Linux machine (should have developed on Linux to start with but that’s a different matter :rolleyes: ) and since then my redirect code doesn’t work any more.

When using the standard code like:




$this->redirect(array('view','id'=>$model1->primaryKey));


or 


$this->redirect(array('view','id'=>'1')); // knowing this key exists


or even 


$this->redirect(array('index'));



in all cases my session hangs. The browser (probably) keeps on trying to open the page and never moves. I have to close and re-open my browser to be able to use my application again. This did not happen in Windows.

There are no errors in the Apache error log or in the php_error_log. The standard yii requirements check shows that all requirements are met.

When I use PHP code like


header('Location: http://myapplication/index.php/model/key'); 

everything works just fine.

I will be using PHP redirect to bypass this issue but I am very curious to find out more about this! Our dev machine is a Redhat Enterprise Linux 5 and uses Apache version 2.2.3 and PHP Version 5.1.6

Any ideas? Thanks!

is it redirecting to that view page?

Hi Rajith,

Not when I’m using the $this->redirect method …

Hi,

try to use Firefox with the Live HTTP Headers extension. It provide the ability to see what headers are being received from the server, thus should help you to resolve the issue.

try redirect to any other page…

check for uppercase/lowercase… linux is case sensitive.

Hi MadAnd, that is a good tip and a great tool to have. The weird thing is that when I have the Yii redirect in place, I get nothing… Nothing at all shows up.


$this->redirect(array('index')) 

should work, just as


$this->redirect(array('view','id'=>'1'));

nothing case-sensitive there, right? I even tried different cases to no avail.

It also happens when I simply enter an invalid URL. In stead of an showing error page the browser just hangs. On other applications on the server I don’t have this behaviour so I think it has to do with the exception handling in my application. To be continued…

When i click on some links it gives me following error , but same time it is working fine on my localhost,

what can be the problem ?

range() [<a href=‘function.range’>function.range</a>]: step exceeds the specified range

When i click on some links it gives me following error , but same time it is working fine on my localhost,

what can be the problem ?

range() [<a href=‘function.range’>function.range</a>]: step exceeds the specified range

Follow the link code :

<?php echo CHtml::link(‘Edit’,array(‘projects/update’,‘id’=>$model->ProjectId),array(‘class’=>‘btn btn-gebo’,‘style’=>‘float:right;’)); ?>