Skip to content

Instantly share code, notes, and snippets.

View gist:9786240
<?php
//redirect for the website
$isFB = strripos($_SERVER['HTTP_USER_AGENT'], 'facebookexternalhit');
if($isFB === false && is_null(JRequest::getVar('signed_request',NULL)) && is_null(JRequest::getVar('nr',NULL)) && is_null(JRequest::getVar('task',NULL)) && JRequest::getVar('view') != 'entrylist' ) {
//Facebook needs to see this page on our domain to get the og tags, but users should be redirected to the tab version
$redirectUrl = 'http://apps.facebook.com/'.$facebook->getAppId().'/?app_data='.json_encode($app_data);
$mainframe->redirect($redirectUrl);
}