Reputation:
If I have an app on facebook that's pulling the content from http://example.com for instance, is there a way I can stop people visting the example.com site and instead redirect them to the facebook app page?
Upvotes: 2
Views: 230
Reputation: 9912
Facebook is sending a POST variable called signed_request
when the page is opened within a Fan Page Tab or the Canvas page of your App. Simply check if the POST variable is there and redirect to your App's Canvas page if not ;-)
Here you can read a bit how the signed_request is used inside an App.
Upvotes: 1
Reputation: 31860
Kalvin is close. Props to Kalvin :)
index.html
index.html
to index-fb.html
https://apps.facebook.com/{yourappname}
format. http://example.com
to http://example.com/index-fb.html
Upvotes: 0
Reputation: 465
Edit the .htaccess or conf.d file on your Apache web server (or the rewrite rules in IIS) to give a 301 Permenant Redirect.
Assuming you have Apache:
1.) Log into the box using ssh or some terminal emmulation program
2.) cd /etc/httpd/conf.d
3.) Locate the the configuration file for your site, edit it using vi, emacs, nano, or some text editor
4.) See here on how to write the rewrite rule.
Upvotes: 0
Reputation: 11
1) Pull your content from your website from a subfolder
2) Redirect them from the index.html using a meta tag: http://www.web-source.net/html_redirect.htm
A better way would be to check if the content is being displayed inside facebook and then redirect but I have no idea how to do that
Upvotes: 0