Reputation: 29
I got a Joomla iframe which displays a webbased application. Now I want to prevent people from browsing to the pages that I use like: http://www.mywebsite.com/webapplicationname/login.php
When browsing to there they should automaticly be redirected to http://www.mywebsite.com and login in the iframe.
So I want to prevent people from browsing to my webapplication and only make it accessible via the iframe. Is there any way that I can do that? Or at least prevent people from accessing the login page via the browser instead of the iframe?
Upvotes: 1
Views: 508
Reputation: 1213
This is the javascript code that checks if a page is loaded inside an iframe:
<script type="text/javascript">if (top === self) { not in a frame } else { in a frame }</script>
You can then put the code to open the iframe inside the else
Upvotes: 3