1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Redirect from Google Images

Discussion in 'Black Hat SEO' started by Bacanze, Oct 4, 2009.

  1. Bacanze

    Bacanze Junior Member

    Joined:
    Nov 12, 2008
    Messages:
    150
    Likes Received:
    49
    Occupation:
    Uni student
    Location:
    UK
    Sorry for the newbie question, but I remember someone posting possibly an Iframe or something which redirected people from Google Images to the actual web page. I know this is possible using .htaccess, php and so on, however this solution was by far the simplest I've seen.

    Help appreciated.
     
  2. AlphaTwin

    AlphaTwin Registered Member

    Joined:
    Jun 11, 2009
    Messages:
    92
    Likes Received:
    51
    When someone clicks the image in Google Images, Google will show the image in a frame. Just include this small javascript in all your pages (maybe the header or footer on your blog) and it will automatically break out of the frame and show the whole website to the user.

    Code:
    <script type="text/javascript">
    	<!--
    		if (top.location!= self.location) {
    			top.location = self.location.href
    		}
    	//-->
    </script>
    
     
    • Thanks Thanks x 2
  3. submitoke

    submitoke Newbie

    Joined:
    Dec 6, 2008
    Messages:
    16
    Likes Received:
    0
    i use this... put on my footer of wp themes.

    Code:
    <script language="javascript" type="text/javascript">
    if (self != top) {
    if (document.images)
    top.location.replace(window.location.href);
    else
    top.location.href = window.location.href;
    }
    </script>
     
  4. fuzion

    fuzion Newbie

    Joined:
    Aug 9, 2008
    Messages:
    26
    Likes Received:
    336
    Occupation:
    suckering suckers and trolling trolls
    Anyone care to share a way to do this with a referer check and a negative match list so we can break all but certain frames?
     
  5. djelica

    djelica Junior Member

    Joined:
    Jun 26, 2009
    Messages:
    151
    Likes Received:
    60
    I use this code to check if visitor is coming from google images and if yes, then close frame and transform useless visitor to worthwhile visitor

    Code:
    $thereferer = strtolower($_SERVER['HTTP_REFERER']); 
    if (strpos($thereferer,"images.google")) {
    
    echo '<script language="JavaScript" type="text/javascript">
    if (top.location != self.location) top.location.replace(self.location);
    </script>'; 
    
    } 
    
     
    • Thanks Thanks x 1
  6. comparco

    comparco Regular Member

    Joined:
    Feb 22, 2008
    Messages:
    291
    Likes Received:
    265
    Occupation:
    trying to make a living online
    Location:
    Scotland
    thanks guys, I can see potential in this, but which one to use. I feel a testing coming on.