views:

333

answers:

2

I have an app that I'm creating with CakePHP, which rewrites the url from something illegible to most users to something a little easier to comprehend. I'm having a problem when I use the FBML canvas.

When I try to access, say, http://apps.facebook.com/myapp/articles, I get the following error:

Received HTTP error code 404 while loading http://www.myapp.com/myapparticles/

I did notice that when I try to access http://apps.facebook.com/myapp/articles/posts, it changes the error to show the following url, which is slightly different: http://www.myapp.com/myapparticles/posts

Which lead me to try accessing it with this: http://apps.facebook.com/myapp//articles, which does work most of the time, though for some reason sometimes it will give the previous error. (And it also seems like a hack-y way of getting it to work).

I'm at a loss for how to fix this.

A: 

This happens when you are not using semantic markup or you have an error or some code not supported by fb. Also that famous error is generated by fb when it is down or slow too.

I would suggest you checking your code thoroughly and going through fb documentation. That should help you the most. thanks

Sarfraz
It's not a problem with the code, as it works perfectly fine off of Facebook. I've been thinking it's a problem (or maybe it's supposed to be this way) with the way FBML handles incoming urls, but I can't find anything that explains it. I've tried looking in their documentation and forums, but can't find the answer.
j.matz
A: 

Turns out I was missing the trailing slash (http://www.myapp.com/myapp/) on the url that I specified as my canvas callback, which is in the app settings. Putting it there fixes the problem.

j.matz