Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Main Support Categories > Server Platforms
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Server Platforms
Discussion regarding the Ubuntu Server Edition. For more information on the Ubuntu Server Team, please visit their wiki page or Launchpad page.

 
Thread Tools Display Modes
Old August 22nd, 2008   #1
Meph1st0
Gee! These Aren't Roasted!
 
Meph1st0's Avatar
 
Join Date: Sep 2007
Location: Las Vegas, Nevada
Beans: 175
Ubuntu 8.10 Intrepid Ibex
turn off hotlink protection

Can someone help me turn off hotlink protection in a subdirectory of my web root? I read an article Here talking about creating an .htaccess file in the directory that I want to enable hotlinking from. So I did that but it's not working.

Can anyone hotlink to http://www.thebrowndomain.com/noduhz...ges/border.jpg ?


I put a .htaccess file in the images folder so that I could hotlink to my pics there on a different web site.

The file has the following code in it:
Code:
# disable hotlink protection
RewriteEngine off
I then restarted my server just in case I needed to restart the apache service.

Am I missing something else I need to do?
__________________
Jonathan Brown
The best part of waking up is not Folgers in your cup...it's knowing that Chuck Norris didn't kill you in your sleep.
Meph1st0 is offline   Reply With Quote
Old August 23rd, 2008   #2
windependence
Tall Cafè Ubuntu
 
windependence's Avatar
 
Join Date: May 2007
Location: Phoenix, Arizona USA
Beans: 2,626
Kubuntu 8.10 Intrepid Ibex
Re: turn off hotlink protection

I'm sorry, I'm not sure what you are referring to as "hot linking". Are you pulling in remote images from a php script or something similar?

-Tim
__________________
"Better to use a Mac and be thought a fool than to use Windows and remove all doubt"
www.windependence.org
Get your Windependence today!
windependence is offline   Reply With Quote
Old August 23rd, 2008   #3
Meph1st0
Gee! These Aren't Roasted!
 
Meph1st0's Avatar
 
Join Date: Sep 2007
Location: Las Vegas, Nevada
Beans: 175
Ubuntu 8.10 Intrepid Ibex
Re: turn off hotlink protection

No, I'm not using any sort of php script or anything of the sort.

I'm just hosting my images on my own personal apache web server.

Then at a different web site, (we could even say myspace or whatever) I'm trying to display those images by using an img tag. <img src="mywebserver.com/images/theimageIwanttodisplay.jpg"/>

"hotlinking" is direct linking to a web site's files (images, video, etc.). An example would be using an <img> tag to display a JPEG image you found on someone else's web page so it will appear on your own site, eBay auction listing, weblog, forum message post, etc.


Another example of hotlinking is what's done at Photobucket.com. You can upload your images and then hotlink to them to display them on a different site.

Apache web server has hotlinking disabled by default. And I can understand the reasoning behind it but I just want to permit hotlinking for a certain folder, not necessarily for my entire web site.
__________________
Jonathan Brown
The best part of waking up is not Folgers in your cup...it's knowing that Chuck Norris didn't kill you in your sleep.

Last edited by Meph1st0; August 23rd, 2008 at 04:41 PM..
Meph1st0 is offline   Reply With Quote
Old August 23rd, 2008   #4
windependence
Tall Cafè Ubuntu
 
windependence's Avatar
 
Join Date: May 2007
Location: Phoenix, Arizona USA
Beans: 2,626
Kubuntu 8.10 Intrepid Ibex
Re: turn off hotlink protection

OK, now that I know what you are doing, I think you might be able to put the directive in an .htaccess file inside the directory instead of turning it on globally. What do you think about that?

-Tim
__________________
"Better to use a Mac and be thought a fool than to use Windows and remove all doubt"
www.windependence.org
Get your Windependence today!
windependence is offline   Reply With Quote
Old August 24th, 2008   #5
Meph1st0
Gee! These Aren't Roasted!
 
Meph1st0's Avatar
 
Join Date: Sep 2007
Location: Las Vegas, Nevada
Beans: 175
Ubuntu 8.10 Intrepid Ibex
Re: turn off hotlink protection

Well that is actually what I've done. I placed an .htaccess file containing the following code in my images folder.

Code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?thebrowndomain\. [NC]
RewriteCond %{HTTP_REFERER} !^http://21601.synsport.com\. [NC]
RewriteCond %{HTTP_REFERER} !google\. [NC]
RewriteCond %{HTTP_REFERER} !search\?q=cache [NC]
RewriteCond %{REQUEST_URI} !^/hotlink\.png$
RewriteRule \.(gif|jpg|png)$ /hotlink.png [NC,L]
The http://21601.synsport.com is the url that I want to give access to hotlink to these images.

I'd rather not turn off hotlink protection globally if I don't have to. Can you see anything wrong with my .htaccess file? By the way, I really do appreciate you helping me with this.
__________________
Jonathan Brown
The best part of waking up is not Folgers in your cup...it's knowing that Chuck Norris didn't kill you in your sleep.
Meph1st0 is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

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

Forum Jump


All times are GMT -4. The time now is 09:36 PM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry