简体   繁体   English

在Facebook画布应用中重定向

[英]redirect in facebook canvas app

Is it possible to do page redirects in canvas app? 是否可以在canvas应用中进行页面重定向? I was reading facebook's tutorial and I am seeing this: 我正在阅读Facebook的教程,并且看到以下内容:

Note that http://www.example.com/canvas cannot forward to another URL via HTTP redirect responses, for example response code 301, but has to return the response directly. 请注意,http://www.example.com/canvas无法通过HTTP重定向响应(例如响应代码301)转发到另一个URL,但必须直接返回响应。

How is this possible? 这怎么可能?

What the documentation says with this is that you should not have your first page that loads in the canvas, which is referenced here as http://www.example.com/canvas , send a 301 redirect to some another page. 文档的内容是,您不应该将第一个页面加载到画布中,在这里将其称为http://www.example.com/canvas ,将301 redirect发送到其他页面。 You should render and send first page, or http://www.example.com/canvas , and then, if your situation requires redirects then you may do the same. 您应该呈现并发送首页,或http://www.example.com/canvas ,然后,如果您的情况需要重定向,则可以这样做。

虽然初始画布页面无法返回301响应,但是您可以让加载的页面通过javascript进行重定向。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM