Question

Is it possible to do page redirects in canvas app? I was reading facebook's tutorial and I am seeing this:

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.

How is this possible?

Was it helpful?

Solution

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. 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.

OTHER TIPS

While the initial canvas page cannot return a 301 response, you can have the loaded page do a redirect via javascript.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top