workaround for "406 Not Acceptable" error
|
SalemKayaker
Joined: 2004-12-25
Posts: 27 |
Posted: Thu, 2006-04-06 13:01
|
|
Just in case anyone else runs into the same problem... I have a customer domain which uses a Menalto Gallery 1.5 application. Everything has been working fine, the customer has been happily uploading images, editing captions, etc. But one of his latest image uploads has been having a problem. The Gallery application uploads the image fine, creates an appropriately sized thumbnail, and one can edit any of the text associated with the image. But if one tries to click on the thumbnail and bring up the full sized image within the application, it fails with the "406 Not Acceptable" error, and the onscreen message: Not Acceptable An appropriate representation of the requested resource Apache/1.3.34 Server at example.net Port 80 I checked that the image file existed, it had the correct permissions, etc. I deleted the image and uploaded it with a slightly different name... Still no go. So I googled the error message and found some hits indicating that it might be a false positive from Mod_Security So I put the following code in the customer's .htaccess file: <IfModule mod_security.c> # The below probably isn't needed... And, sure enough, the problem went away. --Doug Gallery URL: http://cahaly.net/gallery |
|

Posts: 13451
Well, mod_security is a serverside setting, which we have no control over. Mod_Security probably doesn't like vibratory stuff. ;-)
h0bbel - Gallery Team
If you found my help useful, please consider donating to Gallery
http://h0bbel.p0ggel.org
Posts: 27
Yeah, I assume there was something in the file name that offended mod_security... I do wonder what it was. I kind of figured that mod_security was looking for code fingerprints in PHP.
--Doug
Salem Design
Posts: 16
Hi Doug
where did you put that in the .htaccess file? I tried it and totally screwed up the gallery. Could you post the text from your file?
Thanks
Noel
Posts: 27
Hello Noel,
In this case we have two galleries (each in their own directory), one level down from the root directory for the site.
I put the following in the .htaccess file at the root level.
The .htaccess files in the two Gallery subdirectories just have the mod-rewrite language.
That worked for me... But I have never understood exactly what mod_security was reacting to in this customer's gallery setup. I have a number of other Galleries set up on the same shared-hosting environment that have no problem... And they do not have mod_security turned off.
If your Gallery is at the root level for your site, I would suggest putting the language above at the very beginning of the .htaccess file.
'Hope this helps.
--Doug
Salem Design