NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page How can I do this?

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 05-20-2007, 11:33 PM THREAD STARTER               #1 (permalink)
NamePros Expert
 
sufi's Avatar
Join Date: Mar 2005
Location: LinksHut.com
Posts: 7,697
sufi has a reputation beyond reputesufi has a reputation beyond reputesufi has a reputation beyond reputesufi has a reputation beyond reputesufi has a reputation beyond reputesufi has a reputation beyond reputesufi has a reputation beyond reputesufi has a reputation beyond reputesufi has a reputation beyond reputesufi has a reputation beyond reputesufi has a reputation beyond repute
 



Question How can I do this?


Hi everyone,

One of my site is getting lots of traffic from Google Images but most of people just hit the "See full-size image" which eats up my bandwidth without any site exposure.

Is there anyway to take them to picture page instead of just the picture link by some type of redirect?

Any help is appreciated. Thanks
sufi is offline  
Old 05-21-2007, 03:13 AM   #2 (permalink)
Senior Member
 
Eric's Avatar
Join Date: Mar 2005
Posts: 4,948
Eric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatness
 

Member of the Month
MOTM September 2005
Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Animal Rescue Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Baby Health Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse Diabetes Protect Our Planet Multiple Sclerosis Autism Adoption Special Olympics
.htaccess
Code:
# would redirect  'someimage.jpg', to 'someimage.html'
# just play around with it, or maybe someone will
# come up with a better way :)
RewriteEngine on
RewriteCond %{HTTP_REFERER} ^google\.com$ [NC]
RewriteRule ^(.*)\.(jpg|jpeg|gif|png|bmp)$ /$1.html [L]
Eric is offline  
Old 05-21-2007, 08:30 AM   #3 (permalink)
You are here: X
 
mr-x's Avatar
Join Date: Oct 2003
Location: US
Posts: 483
mr-x is a glorious beacon of lightmr-x is a glorious beacon of lightmr-x is a glorious beacon of lightmr-x is a glorious beacon of lightmr-x is a glorious beacon of light
 



If your *NOT* running ads in an iframe (adsense), you can use javascript to break out of the google frame and leave your visitor at the thumbnail page.

Code:
if (window != top) top.location.href = location.href;
If you want to use .htaccess to redirect the viewer, you can filter the image through a script that adds your domain name as as watermark or redirects the viewer to another page.

Code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.com/.*$ [NC]
RewriteRule \.(gif|jpg|png)$ http://www.example.com/thumbs.php?img=%{SCRIPT_FILENAME}% [R,L]
You may find a better example at http://phpthumb.sourceforge.net/
mr-x is offline  
Old 05-21-2007, 09:46 AM THREAD STARTER               #4 (permalink)
NamePros Expert
 
sufi's Avatar
Join Date: Mar 2005
Location: LinksHut.com
Posts: 7,697
sufi has a reputation beyond reputesufi has a reputation beyond reputesufi has a reputation beyond reputesufi has a reputation beyond reputesufi has a reputation beyond reputesufi has a reputation beyond reputesufi has a reputation beyond reputesufi has a reputation beyond reputesufi has a reputation beyond reputesufi has a reputation beyond reputesufi has a reputation beyond repute
 



Thanks both of you for help. I guess I'll just use the frame breaking thingy because I still can't figure out anything about that .htaccess thing.
sufi is offline  
Old 05-22-2007, 05:10 PM   #5 (permalink)
NamePros Regular
 
monaco's Avatar
Join Date: Jul 2005
Location: Tucson, AZ
Posts: 689
monaco will become famous soon enough
 



If you have a cPanel hosting account you can go into the "hotlink prevention" tool which will generate the .htaccess file for you that will redirect them to wherever you want.
__________________
My Website | My Blog
monaco is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 05:47 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger