0

I have a small website where the index has an iFrame where all the content (sections in the same website) is loaded. As I want this content to be cached and shown by Google and other search providers, I don't want to use metadata like NOINDEX NOFOLLOW for this content (almost plane text) pages, but I want this: If people come to these pages in a full browser tab (that is: not inside the frame called #MainFrame) I want the page to simply redirect itself to the index.html

What should I do, some help? Thank you in advance

LeanDroid
  • 43
  • 1
  • 2
  • 8

1 Answers1

4

Check if the iframe location is the same as the top window location:

if (window.location.href == window.top.location.href) {
  window.location = "index.html";
}
Guffa
  • 687,336
  • 108
  • 737
  • 1,005
  • That worked PERFECTLY and even if I don't know so much of javascript, I can easily understand what's happening. Thank you a lot!! – LeanDroid Nov 01 '13 at 23:07