![]() |
Redirecting ALL image traffic...how to?
so, I tried earlier and all everyone came back with was frame busters, which doesn't suit my needs
I have tons of 404 image traffic....my blog used to be all rss feeds, I revamped it and changed the permalink structure and now I have TONS of google, ask jeeves and msn image traffic... how can I set my htaccess up to redirect all image traffic to my main page? so, when someone goes here http://images.ask.com/fr?q=Rate+My+P...age%253D1&qt=0 it automatically pulls them out of the frame and to my main site....the image is from an rss feed, so when they click it they will go to it, but I wanna bust them out of the frame and to my home page, not the 404 page |
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 %{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. |
Quote:
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 |
Quote:
THANKS! I was trying to find the thread you posted this in the other day and didn't have any luck this is EXACTLY what I needed |
Quote:
|
nevermind, I spoke before I tried it, it works perfectly
|
weird, doesn't seem to work with http://images.ask.com/
|
Quote:
|
Quote:
|
fuzebox to the rescue!!
thanks =) very useful. |
and you did add to the list of conditions:
Code:
RewriteCond %{HTTP_REFERER} ^http://images.ask |
All times are GMT -7. The time now is 08:00 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123