UnitedForums - UK Web Hosting Forum UnitedHosting Community Hosting Forums
Network and Server StatusCustomer SupportUK Web Hosting
UnitedHostingUnitedHosting Sitemap UK Hosting ForumUK Web HostingWeb Hosting ForumsUK Reseller HostingWeb Host CommunityUK Managed Dedicated ServersHosting Help and SupportUK Domain Name Registration

Go Back   UnitedForums.co.uk > UnitedHosting Community > Webmaster Discussion

Reply
 
Thread Tools Rate Thread Display Modes
Old 6th August 2007, 12:13 AM   #1 (permalink)
Black-Artist
online sycophant
 
Black-Artist's Avatar
 
Join Date: Jul 2007
Posts: 13
Hotlinking

Hi People,

does anyone know if there is any hotlink protection in the control panel?

If not can someone suggest how to stop hotlinking to images, I have tried using .htaccess but it then blocks the images on my site, instead of externally.

Any help appreciated.

BA
Black-Artist is offline   Reply With Quote
Old 6th August 2007, 04:17 AM   #2 (permalink)
UH-Matt
Administrator
 
UH-Matt's Avatar
 
Join Date: Oct 2002
Location: London, UK
Posts: 8,127
Have you searched these forums? Htaccess is the right thing to use and you can use it to block from external sites but not your own, im sure the code has been posted many times before..
__________________
.
Matt
UnitedHosting Staff

For official support please use our helpdesk at UnitedSupport.co.uk

UnitedHosting proudly hosting more than 20,000 sites since 1998.
UH-Matt is offline   Reply With Quote
Old 4th April 2008, 06:49 AM   #3 (permalink)
Lindyloo
Registered User
 
Join Date: Aug 2007
Posts: 9
Hotlink fix in .htaccess - love it but needs improvement

I use the following:
Stop the b******** stealing my bandwidth

This works beautifully and instead of the hotlinkers site or blog showing the image they intended to see, they see this

This unfortunately works too well as I want to be able to cross hotlink from myownmainwebsite1 to myownmainwebsite2 (and vice versa).
Is there a line I can add to the following code to allow hotlinking from selected sites?

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ http://www.yourdomain.com/hotlink.jpg [R,L]

If there is, please post it or pm me.
Thanks.
LL
Lindyloo is offline   Reply With Quote
Old 4th April 2008, 07:34 AM   #4 (permalink)
Samizdata
Virtual Dilettante
 
Join Date: Nov 2006
Location: Planet Earth
Posts: 178
Quote:
Originally Posted by Lindyloo View Post
Is there a line I can add to the following code to allow hotlinking from selected sites?
I would suggest something like this:
Code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain\.com [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourotherdomain\.com [NC]
# Put any other friendly domains here as above
RewriteCond %{REQUEST_URI} !^/hotlink
RewriteRule \.(gif|jpg)$ http://www.yourdomain.com/hotlink.$1 [NC,L]
This would require both a substitute .gif and a substitute .jpg file, but it does demonstrate how it might be adapted for other file types.
__________________
The Silhouettes - 50th Anniversary Website
Samizdata is offline   Reply With Quote
Old 4th April 2008, 08:06 AM   #5 (permalink)
Lindyloo
Registered User
 
Join Date: Aug 2007
Posts: 9
Brilliant!
and before 8am as well.
Thanks Samizdata.
LL
Lindyloo is offline   Reply With Quote
Reply


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

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

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


All times are GMT. The time now is 10:38 AM.

UK Web Hosting  |  UK Reseller Hosting  |  UK Dedicated Servers UnitedHosting  |  UnitedSupport  |  UnitedForums  |  SEO by vBSEO 3.0.0
Copyright © 1998-2008 United Communications Limited. All Rights Reserved. Registered in England and Wales 3651923 - VAT Reg No. 737662309