Forum Moderators: phranque
I read somewhere that you can redirect a hotlinked image, kinda like breaking out of frame and redirect to a different page, but I have never seen that code. Is this even possible? If so, where can I find the info how to this?
Thanks a bunch!
Kamilla
Welcome to WebmasterWorld [webmasterworld.com]!
This thread [webmasterworld.com] has an example of code to accomplish this in .htaccess under Apache. You can find many more examples by searching in WebmasterWorld for "hotlink" and variants of that word.
Jim
If you mean "authorized using Apache's password authorization mechanism," then no, I don't know how you'd do that. The 401-Authorization Required exchange protocol is rather crude and inflexible. I suppose you could write your own authorization-handling script, and wrap your protected content in it.
If you just want to create a list of sites that are or are not allowed to hotlink, then the example I cited, which contains one site which is not allowed to hotlink, can serve as an appropriate starting-point example.
Ref: Introduction to mod_rewrite [webmasterworld.com]
Jim
Can you redirect from an image to a document, for eaxmple from a .gif file to an .html file?
The answer here would be no, a client (e.g. browser) expects the document it requested to be served, or at least a document having a similar type (MIME-type) to the one it requested. And the client actually specifies what MIME-types it will accept in the HTTP Request header that it sends to the server.
So, you can usually get away with redirecting from, say gif to jpeg, but not from jpeg to html. The browser will get confused and just show a broken image link.
Jim