Forum Moderators: phranque

Message Too Old, No Replies

.htaccess hotlinking question

Allow images to only be displayed from one domain?

         

bondjamesbond

2:36 pm on Oct 31, 2003 (gmt 0)

10+ Year Member



Hi,

I'm quite new to .htaccess, my current file only contains simple things like denying access to the file, denying access to directories and some redirects.

My current sitution is all my files are stored on one server, while all my images are stored on another (to save space). Is it possible to set up some kind of rewrite rule that only allows images to display if they are got from the "image" server?

So when someone visits the site the images are correctly displayed as they are coming from the "Image server" through the "file" server. Now if someone tried to directly link to an image on the "image" server, they would get a fobidden page as the request has not come from the "file" server.

Apoligies if this doesn't make much sense! I have been looking at the various other useful .htaccess posts but none seem to answer my question.

Many thanks for any help!

jdMorgan

3:17 pm on Oct 31, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



bondjamesbond,

We had a similar thread last week that illustrates some of the issues:

[webmasterworld.com...]

The basic problem is that HTTP_REFERER is unreliable, and so cannot be depended upon to differentiate "good" from "bad" requests. The main problem is that it is often blank, and then it provides *no* information. If you assume that blank is "bad," then you risk shutting out those behind home and corporate firewalls and proxies that block HTTP_REFERER.

Jim

bondjamesbond

3:31 pm on Oct 31, 2003 (gmt 0)

10+ Year Member



Thanks for the link Jim.