
Originally Posted by
philnolan3d
So what I'd like to do is have the child page automatically load the main site if someone hits it by accident, like through Google or another search engine.
Try this in the <head> section. As well as restoring an orphaned document, it will break out of any foreign frameset. Just change 'mysite.com' to your top domain.
Code:
(function(myURL)
{
try
{
if(top==self || top.document.domain != self.document.domain)
top.location.href = myURL;
}
catch(e){ top.location.href = myURL; }
})( "http://mysite.com" );
Bookmarks