View Single Post
Old 04-12-2007, 06:23 PM  
JD
Too lazy to set a custom title
 
Industry Role:
Join Date: Sep 2003
Posts: 22,651
Quote:
Originally Posted by fuzebox View Post
This should work.

1) create file called googleimages.php in your root dir

<html><head><title>Loading Site...</title>
<script language="Javascript">
<!--
if (top.location != location) top.location.href = 'http://<? print $_SERVER["SERVER_NAME"] . $url;?>';
//-->
</script>
</head>
<body><center><a target=_top href="http://<? print $_SERVER["SERVER_NAME"] . $url; ?>">Click Here To Load The Site</a></center>
</body></html>

2) add this to .htaccess:

RewriteEngine On
RewriteCond &#37;{HTTP_REFERER} ^http://images.google
RewriteCond %{REQUEST_URI} !googleimages.php
RewriteCond %{REQUEST_URI} (.*)
RewriteRule /* /googleimages.php?url=%1 [R,L]



You can edit the php file to send em to your root instead if you want, and of course add the other image search services to the .htaccess.
that works GREAT btw!

if you want the hits to send to your main page then just change the line in googleimages.php that says http://<? print $_SERVER["SERVER_NAME"] . $url; ?> to http://www.domain.com

edit: hit me up to see it in action

Last edited by JD; 04-12-2007 at 06:24 PM..
JD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote