I am using a facebook app to display a facebook themed version of the webiste within a facebook tab. This works fine.
The problem is when I want to link to the main site (not in the app, but via an update or in the about page for example) that should take the user away form facebook and to the main website.
facebook doesn't link directly to webpages, they pass the url through a script first which is confusing my website into thinking the page is within the app and displaying the facebook version of the website.
So for example, a facebook visitor clicks the link to open the main website, they are prsented with the facebook version.
I made a getaround for the homepage using javascript, a simple refresh of the page loads the correct website. So I created a landing page /fb/ containing just
But I now want to link directly to other pages. Can I put similar javascript into the header on every page, if the user comes from facebook (so I guess the url contains the word facebook) to refresh the page, otherwise do nothing?
Thanks
The problem is when I want to link to the main site (not in the app, but via an update or in the about page for example) that should take the user away form facebook and to the main website.
facebook doesn't link directly to webpages, they pass the url through a script first which is confusing my website into thinking the page is within the app and displaying the facebook version of the website.
So for example, a facebook visitor clicks the link to open the main website, they are prsented with the facebook version.
I made a getaround for the homepage using javascript, a simple refresh of the page loads the correct website. So I created a landing page /fb/ containing just
Code:
<script type="text/javascript">
window.location.href="[URL unfurl="true"]http://www.mywebsite.com"[/URL]
</script>
<noscript>
<meta http-equiv="refresh" content="0;url=http://www.mywebsite.com" />
</noscript>
But I now want to link directly to other pages. Can I put similar javascript into the header on every page, if the user comes from facebook (so I guess the url contains the word facebook) to refresh the page, otherwise do nothing?
Thanks