Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 11th, 2009, 03:49 PM
davidb2002's Avatar
davidb2002 davidb2002 is offline
Almighty God of Nothing
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2005
Location: Rotherham, UK
Posts: 698 davidb2002 User rank is Sergeant Major (2000 - 5000 Reputation Level)davidb2002 User rank is Sergeant Major (2000 - 5000 Reputation Level)davidb2002 User rank is Sergeant Major (2000 - 5000 Reputation Level)davidb2002 User rank is Sergeant Major (2000 - 5000 Reputation Level)davidb2002 User rank is Sergeant Major (2000 - 5000 Reputation Level)davidb2002 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 5 Days 4 h 59 m 27 sec
Reputation Power: 54
Send a message via ICQ to davidb2002
Question Allow hotlinking from domains on IP

Simple question....complicated answer

I need to allow hotlinking on any domain/website that is on the same certian IP address or server as my main site. But I don't want to open up hotlinking to any site.

Thanks for any help.

Reply With Quote
  #2  
Old June 12th, 2009, 02:33 PM
SteffenL SteffenL is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 76 SteffenL User rank is First Lieutenant (10000 - 20000 Reputation Level)SteffenL User rank is First Lieutenant (10000 - 20000 Reputation Level)SteffenL User rank is First Lieutenant (10000 - 20000 Reputation Level)SteffenL User rank is First Lieutenant (10000 - 20000 Reputation Level)SteffenL User rank is First Lieutenant (10000 - 20000 Reputation Level)SteffenL User rank is First Lieutenant (10000 - 20000 Reputation Level)SteffenL User rank is First Lieutenant (10000 - 20000 Reputation Level)SteffenL User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 12 h 35 m 35 sec
Reputation Power: 110
I am not completely sure I get what you mean, but I will try to answer you.

I am thinking two possible situations:
1. Allow "hotlinking" where one website wants to download something from a different website on the same server. You need to allow or block hotlinking based on who is downloading the resource.
2. Allow hotlinking from a website, which a client needs to download resources from while visiting a different website. You need to allow or block hotlinking based on which website the client is visiting.

Are any of these what you want?

If it's the first one, you need to block access when %{REMOTE_ADDR} is not the server's IP address.
If it's the second one, you need to block access when %{HTTP_REFERER} does not contain one of the websites' domain.

Example for the first one:
Code:
# allows you to specify which files this applies to
RewriteCond %{REQUEST_FILENAME} \.(?:js|css|gif|png|jpg)$
# if the client's (server's) IP address is not this
RewriteCond %{REMOTE_ADDR} !^0\.0\.0\.0$
# forbid access
RewriteRule .* - [F,L]

Example for the second one:
Code:
# allows you to specify which files this applies to
RewriteCond %{REQUEST_FILENAME} \.(?:js|css|gif|png|jpg)$
# if the client did not come from this site
RewriteCond %{HTTP_REFERER} !^https?://www\.domain\.com/
# forbid access
RewriteRule .* - [F,L]

Please change the code to suit your needs.

If you go for the second solution, you should know that it does not stop anyone from changing/faking/spoofing the referer header if they want to, but it is better than nothing.
Also, certain firewalls may change or clear this header to protect users' privacy. They will not be able to view your website properly because the referer header no longer contains one of the websites you want to allow hotlinking from.

I hope I could answer your question.
If not, I hope at least someone here can learn something from this.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Allow hotlinking from domains on IP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
Stay green...Green IT