![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
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 |
|
|
#1 |
|
Gee! These Aren't Roasted!
![]() 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 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. |
|
|
|
|
|
#2 |
|
Tall Cafè Ubuntu
![]() 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! |
|
|
|
|
|
#3 |
|
Gee! These Aren't Roasted!
![]() 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.. |
|
|
|
|
|
#4 |
|
Tall Cafè Ubuntu
![]() 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! |
|
|
|
|
|
#5 |
|
Gee! These Aren't Roasted!
![]() 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]
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. |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|