-3

I have a website: galiro.com/summer.html I want to redirect people who use my website in an iframe to the actual website. Is this possible?

El Hombre
  • 73
  • 7
  • 1
    Algorithm is: -> Check if the window and parent window are same. -> If they are, do nothing. -> If they aren't, change parent window address and start again. – hjpotter92 Jul 15 '12 at 21:48
  • possible duplicate of [Prevent iframe stealing](http://stackoverflow.com/questions/5522097/prevent-iframe-stealing) – Zeta Jul 15 '12 at 21:49

1 Answers1

4

This should do it:

if (window.top != window.self)  { 
    window.top.location.href = "http://galiro.com/summer.html";
}
Esailija
  • 138,174
  • 23
  • 272
  • 326
Elliot Bonneville
  • 51,872
  • 23
  • 96
  • 123