Forum Moderators: phranque
Welcome to WebmasterWorld [webmasterworld.com]!
Please see our charter [webmasterworld.com].
You don't need any code to allow hotlinking -- It is the default behaviour to allow all accesses.
If you want to hire someone to rewrite your code, please see our Commercial Exchange [webmasterworld.com] forum.
Jim
as far as the question is concerned, i thought so my self. i just needed some confirmation. but i also do have the problem with hotlinking files in IE. i obviously accussed .htaccess file without the reason. you see, whenever i hotlink any zip/rar/exe file (images and html work normally) on my server from IE i can't download it. i get an error saying: "IE cannot download myfile.rar from mysite.com. the requested file is either unavailable or cannot be found." but when i click on that file from my web pages it can be downloaded normally. i don't have that kind of problems in Opera and Mozilla FireFox.
Any suggestions?
That's pretty strange... In most cases, the problem is just the reverse: files can be downloaded with IE but not with Mozilla or Opera clients. This is because IE often uses the actual content of a file to determine its MIME-type, whereas Mozilla and Opera look for a valid MIME-type header in the server response. So often, we see the situation where a multimedia file downloads fine in IE, but opens a dialog box in other browsers asking "What do you want to do with this file? Open, save to disk, etc." And the reason is that no MIME-type has been associated with that file type on the server, so the server is not returning an appropriate MIME-type header.
This is easily solved in Apache by adding AddType directives, such as
AddType application/x-rar-compressed .rar I'd suggest looking through your .htaccess file to see if .zip-, exe-, and .rar-type files get any special treatment with regard to hotlinking. Also, examine your httpd.conf file for the same thing (or ask your hosting provider to do so).
It might still come down to a MIME-type problem, but I can't really tell.
Jim