PHP头()在Google App Engine中重定向 [英] PHP header() redirect in Google App Engine

查看:88
本文介绍了PHP头()在Google App Engine中重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用

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();

它在我的本地开发环境中工作。在Google App Engine上,我收到了301,但没有重定向到新位置,而是出现白屏。

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.

推荐答案

这是一个编码问题。我不得不urlencode()$ location的所有部分。在我当地的MAMP环境中没有问题。

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

这篇关于PHP头()在Google App Engine中重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆