3

I try to make a header redirect on an Google App engine instance with

header("HTTP/1.1 301 Moved Permanently");
header("Location: http://".$location);
header("Connection: close");
die();

It's working on my local development environment. On Google App Engine I receive the 301 but it doesn't redirect to the new location, instead there's a white screen.

Lars Ebert
  • 3,487
  • 2
  • 24
  • 46
Stephan
  • 461
  • 1
  • 5
  • 17
  • I would suspect this has nothing to do with CakePHP. Try creating a plain old php file and put your snippet in there. Then check if that works on the Google App Engine. If not, the problem has nothing to do with CakePHP. – Lars Ebert Aug 26 '15 at 14:40
  • No, it has nothing to do with CakePHP. – Stephan Aug 26 '15 at 14:47
  • I edited your question to remove CakePHP. This should make the problem more clear. – Lars Ebert Aug 26 '15 at 14:52
  • I'm unable to reproduce this. Do you have a valid value for `$location` variable? – Mars Aug 26 '15 at 20:23

1 Answers1

1

It was a encoding problem. I had to urlencode() all parts of $location. On my local MAMP environment there was no problem.

Stephan
  • 461
  • 1
  • 5
  • 17