Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2003
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    .HTAccess question....

    Not sure if this is the right place to ask, but I couldn't find anything related to this anywhere else...

    With regards to blocking people from hotlinking to files on a server, an alternate method is available to show an alternate image if someone tries to hotlink.
    Is it possible to configure the htaccess file to only show an alternate image to a certain IP, rather than everyone who hotlinks?
    So if for instance, if everyone viewed...

    http://myserver.com/image.jpg

    But I wanted IP (127.0.0.1 as an example) to view

    http://myserver.com/image1.jpg, instead, is that possible?

  • #2
    Regular Coder Feyd's Avatar
    Join Date
    May 2002
    Location
    Los Angeles, CA Maxim: Subvert Society
    Posts
    403
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you are going to block that IP, it would be easier just to block the IP completely, rather than just images (since chances are if you want to block certain IPs, those IPs are probably pretty bad siphons).

    Just do

    <Limit GET>
    order allow,deny
    allow from all
    deny from 123.456.789.012
    deny from 124.457.
    </LIMIT>

    Note that the second 'deny from' would block a smaller octet set (meaning anything matching the first 2 octet sets, and any wild cards in the 3rd and 4th positions).

    If it is from another site you could try the standard mod_rewrite rules, but add

    RewriteCond %{HTTP_HOST} !^123.12.123.2(:80)?$
    RewriteCond %{HTTP_HOST} !^www.thiefsite.com(:80)?$

    (I've never tried this option, if I'm denying anything by IP, I'd rather block the IP from everything, but the second option should still work)
    Moderator, Perl/CGI Forum
    shadowstorm.net - subvert society

  • #3
    New Coder
    Join Date
    Jul 2002
    Location
    Los Angeles
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Maybe this will help
    http://www.webmasterworld.com/forum10/3272.htm
    ----

    I've been looking for a way to prevent image hotlinking via IIS. I've looked around for awhile and have not had any luck.

    My hosting has win2k IIS running ASP 3, without ASP.net. Anyone tried and succeeded with a free solution?

    -----
    I've had ppl link to images on my site and its chewing up my bandwidth.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •