[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

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


Closed Thread
 
LinkBack Thread Tools
Old 05-20-2007, 10:33 PM   #1 (permalink)
NamePros Expert
 
sufi's Avatar
 
Join Date: Mar 2005
Location: LinksHut.com
Posts: 7,377
82.88 NP$ (Donate)

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 online now  
Old 05-21-2007, 02:13 AM   #2 (permalink)
NPQ's PA, Slave, and On Call Coder

Technical Services

 
Eric's Avatar
 
Join Date: Mar 2005
Posts: 4,545
0.71 NP$ (Donate)

Eric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond repute

Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse
.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, 07:30 AM   #3 (permalink)
You are here: X
 
tres's Avatar
 
Join Date: Oct 2003
Location: US
Posts: 437
1.25 NP$ (Donate)

tres is just really nicetres is just really nicetres is just really nicetres is just really nice


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/
tres is offline  
Old 05-21-2007, 08:46 AM   #4 (permalink)
NamePros Expert
 
sufi's Avatar
 
Join Date: Mar 2005
Location: LinksHut.com
Posts: 7,377
82.88 NP$ (Donate)

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 online now  
Old 05-22-2007, 04:10 PM   #5 (permalink)
NamePros Regular
 
monaco's Avatar
 
Join Date: Jul 2005
Location: Tucson, AZ
Posts: 695
314.80 NP$ (Donate)

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 11:13 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85