.htaccess hotlinking help required

Discussion in 'HTML' started by Tigger, Jan 26, 2004.

  1. Tigger

    Tigger Guest

    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.
    Tigger, Jan 26, 2004
    #1
    1. Advertising

  2. Tigger

    Tigger Guest

    >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.
    Tigger, Jan 26, 2004
    #2
    1. Advertising

  3. Tigger

    m Guest

    Tigger wrote:
    > 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.
    --
    cheers m
    m, Jan 26, 2004
    #3
  4. Tigger

    kayodeok Guest

    "Tigger" <> wrote in
    news:KObRb.11459$:

    > 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

    --
    Kayode Okeyode
    http://www.kayodeok.co.uk/weblog/
    http://www.kayodeok.btinternet.co.uk/favorites/webdesign.htm
    kayodeok, Jan 26, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sandi
    Replies:
    6
    Views:
    527
    Sandi
    Jul 26, 2003
  2. Dark Angel

    .htaccess & Hotlinking

    Dark Angel, May 1, 2004, in forum: HTML
    Replies:
    2
    Views:
    449
    Dark Angel
    May 2, 2004
  3. Dark Angel

    Hotlinking problem solved

    Dark Angel, May 4, 2004, in forum: HTML
    Replies:
    6
    Views:
    389
    Dark Angel
    May 4, 2004
  4. gcc

    Image Hotlinking

    gcc, Jun 10, 2005, in forum: HTML
    Replies:
    3
    Views:
    463
    Roy Schestowitz
    Jun 10, 2005
  5. Replies:
    7
    Views:
    738
Loading...

Share This Page