Jump to content

Recommended Posts

is it correct to write

 

RewriteCond %{HTTP_REFERER} !^http://(www\.)?yoursite.com/.*$ [NC]

 

instead of

 

RewriteCond %{HTTP_REFERER} !^http://www.yoursite.com/.*$ [NC]

RewriteCond %{HTTP_REFERER} !^http://yoursite.com/.*$ [NC]

:unsure:

Link to post
Share on other sites

I tried the code above and that elegant line you suggested in another thread

>RewriteCond %{HTTP_REFERER} !^http://(.*\.)?yoursite.com(/)?.*$     [NC]

And it doesn't work sometimes, I mean I've seen requests for hotlink.png and referer was my domain. I don't know why ;)

Is it OK to edit .htaccess with file manager's Edit File, btw?

 

So, I switched back to the code cpanel generates, it seems to work all the times...

but not for everyone.

We have 2 computers - normal and weird :) On normal one hotlink protection works, on weird one it doesn't:

If I forbid direct requests I can't see any images on my own page. Btw, I can't see some family members' images, Virtual Imager's for example.

If I allow direct requests I can see all images including hotlinked ones. I mean if I go to a page hotlinking my images I see the original images, but not hotlink.pngs

As I understand it happens because on the weird computer browsers don't send Referer HTTP header [or something :blink:]

 

The reason I'm so into it :( is that I had annoying case of hotlinking from one subdomain, which ate ~0.7GB last month, so I decided to do something about it. The hotlink protection was enabled, but it didn't bother them. Using a nastier hotlink.png seems to be helping naughty.gif but innocent people can suffer too, like those ones who translate your pages :lol:

Is it possible to redirect everyone to hotlink.png

and badsite.com users to nastyhotlink.png?

Link to post
Share on other sites
As I understand it happens because on the weird computer browsers don't send Referer HTTP header [or something :blink:]

Yes. There are some (small amount of) browsers that may not send referrer information.

 

Is it possible to redirect everyone to hotlink.png

and badsite.com users to nastyhotlink.png?

 

Quite honestly, if bandwidth is an issue, you'd be better off just selecting not to redirect them to another image, instead just deny access. Then there is virtually no bandwidth used up on your end, and they'll just get a broken image on their page. Redirecting them to an anti-hotlinking image will still eat up your bandwidth if they don't remove the hotlink.

 

That can all be done in the cpanel hotlinking settings.

Link to post
Share on other sites

Ah, I almost forgot you can just deny access :D

Will do next time. Thanks!

 

In that particular case redirecting them to anti-hotlinking image was the only way to send them a message.. well, at least the only way I could find :lol:

cafe.naver.com

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...