Monday, July 1, 2013

Re: 301 infinite redirect

Sorry, I tried to explain but my "spanish" english is bad :/

What I wanted yo say is that not exists that information, seems like is not executed redirect in the loop. Anyway, I have a log message in AppController::beforeFilter() that neither appears for "/testredirect/test".

All my log information for the case is:

2013-07-01 20:50:28 Error: Inside AppController::beforeFilter(). $this->here: /testnews/test
2013-07-01 20:50:29 Error: $here: /testnews/test
2013-07-01 20:50:29 Error: $status: 301
2013-07-01 20:50:29 Error: Array
(
    [controller] => testredirect
    [action] => test
)

2013-07-01 20:50:29 Error: AppController::redirect() - APP/Controller/AppController.php, line 47
TestnewsController::test() - APP/Controller/TestnewsController.php, line 13
ReflectionMethod::invokeArgs() - [internal], line ??
Controller::invokeAction() - CORE/Cake/Controller/Controller.php, line 486
Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 187
Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 162
[main] - APP/webroot/index.php, line 96

And 301 loop with /testredirect/test (watching the headers) occurs like a ghost :)

Albert


El dilluns 1 de juliol de 2013 19:07:25 UTC+2, AD7six va escriure:


On Monday, 1 July 2013 18:31:56 UTC+2, floydbrush wrote:
Hi AD,

thanks for the help. I'm still trying to solve this problem.

If I use a redirect 301 from /testnews/test to testredirect/test with $this->redirect(array('controller' => 'testredirect', 'action' => 'test'), 301);

I get this headers:

GET /testnews/test HTTP/1.1
Accept: */*
Accept-Encoding: gzip
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Accept-Language: en-us,en;q=0.5
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36
Connection: Keep-Alive
SERVER RESPONSE: 301 Moved Permanently
Date: Mon, 01 Jul 2013 16:16:18 GMT
Server: Apache
X-Powered-By: PHP/5.3.2-1ubuntu4.17
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 20
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html; charset="UTF-8"
GET /testredirect/test HTTP/1.1
Accept: */*
Accept-Encoding: gzip
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Accept-Language: en-us,en;q=0.5
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36
Connection: Keep-Alive
SERVER RESPONSE: 301 Moved Permanently
Date: Mon, 01 Jul 2013 16:16:18 GMT
Server: Apache
Vary: Accept-Encoding
Content-Encoding: gzip
X-Powered-By: PHP/5.3.2-1ubuntu4.17
Age: 0
Content-Length: 20
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Content-Type: text/html; charset="UTF-8"

And so on...

So, logging I can not find the problem. 

2013-07-01 18:16:18 Error: /testnews/test

Where is the debug output for the url "/testredirect/test"

?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: