.htaccess hotlinking help required

T

Tigger

Hi all,
I run a large and sprawling collection of image/gallery heavy websites, and
recently moved from free server space to donated Windows space...that's
where my problems began. As I was only squatting I couldn't write the
robots.txt for the space, meaning my site's images were being called on mass
from many search engines. Without rewrting all the pages the only solution
was to move to Unix hosting, giving me the option to use .htaccess. I'm now
at the end of my tether. I've googled and found numerous sites that give the
suggested format for preventing hotlinking using .htaccess, but the format
of the scripts leaves me with one of three results. 1) The images can be
called from anywhere. 2) The images can't be called, even from my own
domains or 3) Access is denied to the entire site. My host is running RedHat
Linux 7.3, Apache 1.3.27 and I have administrator access. So where am I
going wrong?

Ideally I want image files to only be called via a link from my domain, but
I don't mind using a more specific deny list if I could be pointed at a way
to do this (preferably by domain name, rather than IP address). My current
..htaccess file, which blocks images from my domain too, looks something like
this:

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://(www\.)?MYDOMAIN.co.uk(/)?.*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp|wav)$ - [F,NC]

Any advice would be gratefully received.
 
T

Tigger

snipped as I forgot to say<

I have now implemented a robot.txt that will prevent search engine hits, but
since the images were being made available they're now being linked to
directly from forums and chat rooms which is putting a strain on my
bandwidth. Hence needing to configure .htaccess as soon as poss.
 
M

m

Tigger said:
Without rewrting all the pages
the only solution was to move to Unix hosting, giving me the option to use
.htaccess.

This makes me suspect that you really need info about
the *Apache* server.

I'm now at the end of my tether. I've googled and found
numerous sites that give the suggested format for preventing hotlinking
using .htaccess, but the format of the scripts leaves me with one of three
results. 1) The images can be called from anywhere. 2) The images can't be
called, even from my own domains or 3) Access is denied to the entire
site. My host is running RedHat Linux 7.3, Apache 1.3.27 and I have
administrator access. So where am I going wrong?

No, you should be able to deny from specific ranges of addresses.
Suggest you get "Apache Server Bible" and check chapter
"Basic Authentication". It's been around for a while, and may
be in your local used book store.
 
K

kayodeok

Ideally I want image files to only be called via a link from my
domain, but I don't mind using a more specific deny list if I
could be pointed at a way to do this (preferably by domain name,
rather than IP address).

Using Mod_rewrite to block hot linked images
http://faq.solutionscripts.com/misc/hot_linking.html

A Users Guide to URL Rewriting with the Apache Webserver
http://www.engelschall.com/pw/apache/rewriteguide/

Module mod_rewrite: URL Rewriting Engine
http://httpd.apache.org/docs/mod/mod_rewrite.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

htaccess file help please 10
prevent hotlinking 2
.htaccess & Hotlinking 2
.htaccess 2
Detecting hotlinking 0
Changing .html in URL 3
redirect to a perl script with htaccess 3
using htaccess to move stuff offsite 1

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top