Anti-hotlinking .htaccess code not working

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

intellivision
Forum Commoner
Posts: 83
Joined: Mon Aug 22, 2005 1:25 am
Location: Orbit

Re: Anti-hotlinking .htaccess code not working

Post by intellivision »

Ahhhh I briefly thought about the regex for handling case, but NC is much more elegant. Thanks!
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Anti-hotlinking .htaccess code not working

Post by josh »

Right, otherwise people could "hack" it by changing to jPg for example. The other thing is some plugins do not pass this. For instance we ran a video hosting site and lost almost a TB of bandwidth overnight due to not realizing windows media player does not send the header at all. Luckily I was on an unmetered pipe. I had to make it generate and store a 1 time use token and validate that token with a php script, the thing is that broke the "streaming" / "Seeking" functionality of the wmv player, so further hacks had to be put in place to make it a seamless solution.

The thing is I'd rather watermark my images. I'd almost rather someone hotlink me and I get the eyes on my content, I see it kind of like the record industry and how they restrict content. But since the company that offered the unmetered line went into bankruptcy now I have to actually pay for my bandwidth :-(
User avatar
php_east
Forum Contributor
Posts: 453
Joined: Sun Feb 22, 2009 1:31 pm
Location: Far Far East.

Re: Anti-hotlinking .htaccess code not working

Post by php_east »

intellivision wrote: If you can see this, it's still not working: Image
Anyone have any ideas why?
->intellivision
have you changed the rewrites ? i wonder why am i still seeing the car ?
just curious. ( cleared me browser cache )
intellivision
Forum Commoner
Posts: 83
Joined: Mon Aug 22, 2005 1:25 am
Location: Orbit

Re: Anti-hotlinking .htaccess code not working

Post by intellivision »

@php_east
I haven't implemented it yet. I just tested it briefly yesterday. I'm seeing idiot leechers on eBay selling odometer gears, and for the Volvo gear guess whose forty ~70k images they're displaying in their auction? Yep.

But one of those sellers is an advertiser on my site, so I'm giving him a couple days to make arrangements. :roll: Like I said, it's complicated.

@josh
I'm on a virtual private server, so bandwidth/cpu is something I have to watch. I have 8 or so of my sites on it and 8 or so client sites, so it must be running smoothly 24/7. Interesting about the stolen TB bandwidth 8O.
intellivision
Forum Commoner
Posts: 83
Joined: Mon Aug 22, 2005 1:25 am
Location: Orbit

Re: Anti-hotlinking .htaccess code not working

Post by intellivision »

Ok, finally implemented this. One more question: anyone have any ideas why it's not swapping out for hotlink.gif? Is it getting caught in a catch-22 because hotlink.gif is hosted on the same domain that's being protected?

There is an image below this line:

Image

^^^ The image above should have its URL rewritten to show http://www.matthewsvolvosite.com/images/hotlink.gif
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Anti-hotlinking .htaccess code not working

Post by Benjamin »

Is this a tech support forum? Oh.. no it's general discussion. My Bad.

We seriously just need to stop replying to posts in the wrong forum.
intellivision
Forum Commoner
Posts: 83
Joined: Mon Aug 22, 2005 1:25 am
Location: Orbit

Re: Anti-hotlinking .htaccess code not working

Post by intellivision »

Thanks! Brilliant idea... now to put it in the forum suited to .htaccess questions...

See where I'm going with this?

:wink:
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Anti-hotlinking .htaccess code not working

Post by Benjamin »

Yes I do, and if I was a moderator I would move this thread.

viewforum.php?f=14
intellivision
Forum Commoner
Posts: 83
Joined: Mon Aug 22, 2005 1:25 am
Location: Orbit

Re: Anti-hotlinking .htaccess code not working

Post by intellivision »

Well darn it, neither of us are moderators now are we. So we're back to where we were before you piped up, except we've both wasted a few minutes of our lives on nothing.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Anti-hotlinking .htaccess code not working

Post by John Cartwright »

Erm.. Moved. :)
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Anti-hotlinking .htaccess code not working

Post by josh »

When I hit your URL I get a 500 error:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Anything being logged?
Post Reply