Redirect from Google Images

Bacanze

Junior Member
Joined
Nov 12, 2008
Messages
159
Reaction score
54
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.
 
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>
 
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>
 
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?
 
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?
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 guys, I can see potential in this, but which one to use. I feel a testing coming on.
 
Back
Top