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.
Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    New to the CF scene
    Join Date
    Jul 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the smart tips. I'll make the changes and let you know.

  2. #17
    New to the CF scene
    Join Date
    Jul 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Span,

    Well I made the changes and after clearing cache/files/cookies (everything) it still will not work.

    Current file copy is as follows (I removed the Error codes for now):

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?allsmartcars\.com/ [NC]
    RewriteCond %{REQUEST_URI} !^graphics/hotlinkedtheft\.gif [NC]
    RewriteRule \.(jpeg|gif|bmp|png|jpg)$ http://www.allsmartcars.com/hotlinkedtheft.gif [R,L]

  3. #18
    Regular Coder
    Join Date
    May 2004
    Posts
    121
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    I wonder why it worked for me yesterday.. but I changed it a bit, the URL in the RewriteRule is a relative one now. This is a 'silent' internal rewrite. If that doesn't work, I don't know.

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?allsmartcars\.com [NC]
    RewriteCond %{REQUEST_URI} !^graphics/hotlinkedtheft\.gif [NC]
    RewriteRule \.(jpeg|gif|bmp|png|jpg)$ /graphics/hotlinkedtheft.gif [L]
    The only weak point from this or other no-hotlinking htaccess codes is that it doesn't work for user agents that hide the referer string or are behind some proxy or firewall.

  4. #19
    New to the CF scene
    Join Date
    Jul 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Span,

    I just tried your re-write. I checked to view http://www.allsmartcars.com/gallery/...ize/001019.jpg at http://altlab.com/hotlinking.html and was able to view it. I chose that image because I know for sure I haven't viewed.

    I'm at a loss.

    Jim

  5. #20
    Regular Coder
    Join Date
    May 2004
    Posts
    121
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Jim, one last possible solution left.. try adding this:

    Options +FollowSymLinks

    as the first line of your .htaccess. Sometimes that is needed. It might also throw a 500 error or do nothing, but it's worth a try.

  6. #21
    New Coder
    Join Date
    Mar 2003
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Span
    Since you can put all your stuff in one .htaccess there's never a need for two of them in the same directory, is there? And obviously - uploading the second one would simply overwrite the first.

    You can add the code above to your existing .htaccess, but you have to allow hotlinking for the 'hotlink' image, so I added a condition:

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain\.tld/ [NC]
    RewriteCond %{REQUEST_URI} !^/path_to/nohotlinking\.jpg [NC]
    RewriteRule \.(gif|jpg)$ http://www.domain.tld/path_to/nohotlinking.jpg [R,L]

    If you don't want the redirect to an anti-hotlinking image, use this:

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain\.tld/ [NC]
    RewriteRule \.(gif|jpg)$ - [F]

    That will simply serve a 403 Permission Denied.



    I just have one question, and I'm an idiot, but I'm also a cautious idiot. I just want to be sure before I take that code and put it in the .htaccess file (since I found it, yay!), do I substitute the word domain for my own, or do I need to change anything else? Do I keep the .tld?

  7. #22
    Regular Coder
    Join Date
    May 2004
    Posts
    121
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    yes you have to replace "domain\.tld" with your own "darkannie\.net".

    .tld is just short for Top Level Domain

  8. #23
    New Coder
    Join Date
    Mar 2003
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts
    YAY! Ok, thank you.


    [edit]

    Yay, it worked. Not only do I spare my bandwidth from robbers, but I also have some free advertising! This rocks so hard. Thank you, everyone! Thank you, thank you, thank you!!!
    Last edited by darkannie; 07-26-2005 at 07:52 PM.


 
Page 2 of 2 FirstFirst 12

Posting Permissions

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