Jump to content

Iframe Redirect


Samrc
 Share

Recommended Posts

I have seen and in the past used a script that limits access on a content page that should only appear within an iframe. Can't find it now.

 

Looking for a redirect script that detects the page is not being viewed from with the iframe and redirects user to the page with the iframe on it.

 

Thanks for any suggestions :thumbup1:

Link to comment
Share on other sites

I have seen and in the past used a script that limits access on a content page that should only appear within an iframe. Can't find it now.

 

Looking for a redirect script that detects the page is not being viewed from with the iframe and redirects user to the page with the iframe on it.

 

Thanks for any suggestions :thumbup1:

 

Have a look here:

 

http://www.design-ireland.net/index.php?ht...n/design-10.php

Link to comment
Share on other sites

Thanks for the link. Will take a look at the script to see the differences.

 

Since last posting, I finally found the script I was trying to locate that I had used quite a while ago. If you try to go to the content page without the frameset around it (direct link to the page), you are redirected. Don't know who wrote the script, never did.

 

 

Each content page needs these lines of code:

<script type="text/javascript" src="iframe.js">

<body onload="detect();">

 

Then I upload a file called iframe.js to the website, into the same directory as the iframe. This file sends the visitor to the home page (index.html) for the directory since that's the page with the iframe on it.

 

function detect()

{ var framesetpage = "index.html"

if (parent.location.href == window.location.href)

parent.location.href = framesetpage}

Edited by Samrc
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...