Portal Home > Knowledgebase > Articles Database > [.htaccess] File extension


[.htaccess] File extension




Posted by zvjezdan, 12-25-2010, 01:04 PM
Problem: Gallery i have does not use file extension when viewing picture directly so it opens as text. Example: Link to picture in gallery: http://4funz.com/Funny-Pictures/random/trust-1084 Direct link to the picture (or you can right click > view picture from gallery): http://4funz.com/Funny-Pictures/random/img-trust-1084 It opens as text in firefox, chrome and opera. IE6 opens it as picture (irony ? ) 1-2 months ago it was working just fine. I did not find anyone with same problem on gallery support forum and i got this replay from my host: "If you're not going to use the .jpg extension, you need an .htaccess file to tell the server what kind of extension it is, so it displays it correctly." Can someone please help me. P.S. Only difference between gallery link and direct link is that direct link has "img-" before picture name. Zvjezdan

Posted by athenspc, 12-26-2010, 08:29 PM
Hi, I am not 99% sure, but I think you have to rename the file to trust-1084.jpg. The server need to identify the file. Change the extension and post here the result. Hope I helped.

Posted by foobic, 12-26-2010, 09:13 PM
Your host and athenspc are right - without a file extension the webserver is sending content as its default mime type (text/html). You need some way to tell it the correct type for these img* files. Yep, IE "sniffs" the mime type from the beginning of the file, ignoring the type specified by the webserver. It can be irritating behaviour when you know what you're doing - eg. forcing a file download for a file type IE "thinks" it knows how to display. Adding the correct file extension would be my preferred method too, but if you must use .htaccess, something like this should work:



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
volumedrive down? (Views: 681)
AYK Solutions Down (Views: 662)
bliksemhosting.com (Views: 864)
dhcart alternative (Views: 641)

Language: