# Not Acceptable + 404 Not Found errors



## Lulu01 (Mar 19, 2009)

Hi, a website I've been designing is about to go live, but one out of the dozen or so people who have been testing it for me cannot download a Word document nor a .pdf from the site. Every time they try, they get this message:

"Not Acceptable
An appropriate representation of the requested resource /images/textFiles/join.pdf could not be found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."

Can anyone suggest a way of resolving this problem?


----------



## php guy (Dec 17, 2004)

"Not Acceptable" is a 406 error having to do with mod_security. It's pretty much a built in feature to protect your server from various attacks and security breaches. There's an easy way and not so easy way to solve this problem. Lets try and hope for the easy one first...

Is the security on the file set to allow the users to access it? Do you know what the chmod is set to on that file that is causing the error? You should be able to check with most FTP clients. You could try setting it to 777 to see if that's the security issue. If not, we'll have to dive into your .htaccess again, or go through your hosting admins.


----------



## allnodcoms (Jun 30, 2007)

Also check permissions on the containing folder... The other thing of course is to check the URL to the file, is that the actual file itself or a sim link?

Danny


----------



## Lulu01 (Mar 19, 2009)

Hi, and thanks for answering my post. I'll check out the things you have suggested today and post back. In the meantime, any thoughts on why this error would appear for only 1 person out of 12 testers?


----------



## allnodcoms (Jun 30, 2007)

OK, had a bit of a deeper look into this one and I don't think it's anything to do with your site. A web browser can send a list to the server which indicates certain characteristics of the data it wants to receive back, for example it can request a specific language, charset or MIME type. This is done by the browser in the form of an 'Accept Header' (more info is available from W3C). when the server receives the HTTP request it checks the accept header, and if the resource on the server doesn't match the criteria in the header, you get a '406'.
Basically, as the accept header comes from the client side, there is not a lot you do about it. Would there be any reason why this particular user might have a stricter browser configuration?

Short of that mate, I'm afraid I can't shed much more light on it, but I hope it helps to narrow down the problem.

Danny


----------



## Lulu01 (Mar 19, 2009)

Hi, I've checked the security etc with my hosting service this morning and it is all set up ok, as are the url's to the files. It's not a browser problem as I have the same version of Google Chrome and can download the files ok, but I am going to ask the user to try a different browser just to be sure.

The user can view various images and text held in the same folders so that suggests that there is nothing preventing her from accessing the relevant files.

I have passwords protecting the site at the moment, which I am going to remove and ask the user to try again, just in case that's causing a problem.

I'll get back to you.


----------



## allnodcoms (Jun 30, 2007)

Would she be trying to access this from, say, a work computer? If the requests are going through a LAN then the headers may be modified for local security reasons.

Just a thought, but it doesn't look like anything to do with your server / host.

Danny


----------



## php guy (Dec 17, 2004)

Well, since it's not a security config, it has to do with her end. I'm guessing at this point it has to do with the configuration of the files and security measures on her end (ie. virus scanners).

So this only happens with .doc(x)'s and .pdf's? Is she trying to download these files or view in web browsers?

Also, how did you get the pdf's? Like, where are they generated from? Have you tried optimizing them? Does this happen with documents of all sizes? Or just larger sized.

And finally, what plugins is she using on her web browser? Does she have trouble viewing pdf's from other web wites or just yours? It's entirely possible this is a problem on her end, not yours.


----------



## Lulu01 (Mar 19, 2009)

allnodcoms said:


> Would she be trying to access this from, say, a work computer? If the requests are going through a LAN then the headers may be modified for local security reasons.
> 
> Just a thought, but it doesn't look like anything to do with your server / host.
> 
> Danny


Hi and thanks for your posts. Re the post above, I think it's a home pc, but I'll double check.


----------



## Lulu01 (Mar 19, 2009)

php guy said:


> Well, since it's not a security config, it has to do with her end. I'm guessing at this point it has to do with the configuration of the files and security measures on her end (ie. virus scanners).
> 
> So this only happens with .doc(x)'s and .pdf's? Is she trying to download these files or view in web browsers?
> 
> ...


Hi and thanks for your post phpguy.

I'm thinking the problem is at the user end. I'm wondering if there are any other messages that come up first.

She's trying to download the files and she's told me that she can download .doc and .pdf files from other sites. The pdf's were generated by another of the site users.

How do I optimize pdf's?

One of the pdf's is 362kb the other document is 215kb so neither is particularly large. I'll ask what sort of size other files are that she's successfully downloaded.

I don't know re plugins, but will see if I can find out.

I'll get back to you once I know more. Thanks very much for your help.


----------



## php guy (Dec 17, 2004)

Lulu01 said:


> How do I optimize pdf's?


http://www.websiteoptimization.com/speed/tweak/pdf/optimizer.html has a very detailed article about the options. There are also web based tools you can just upload a pdf to and get an optimized copy back, just google search for those (I've never used them, so I can't really suggestion one in specific).

To rule out the file itself, could you possible upload the same files to another server then see if she could download it from there? I'm quiet puzzled at this point and it would help to start narrowing the problems down.


----------



## Lulu01 (Mar 19, 2009)

Hi, and thanks for your post phpguy.

When I removed the password protection, the user can happily download everything. It's a bit of a mystery as to why she couldn't download forms and everyone else could though. Still, it seems to be ok now.

Thanks for all your help.


----------



## php guy (Dec 17, 2004)

Doh, how could I overlook that?! Could you post the code you used for the password protection?


----------



## Lulu01 (Mar 19, 2009)

php guy said:


> Doh, how could I overlook that?! Could you post the code you used for the password protection?


Hi there, I didn't actually write the code. I used Password Protect Directories in cPanel and it wrote the code for me:


```
AuthUserFile "/data02/c2001364/.htpasswds/public_html/passwd"
AuthName "OBTest"
AuthType Basic
require valid-user
```
Any thoughts on why it impacted on only 1 person?


----------



## php guy (Dec 17, 2004)

Honestly, I couldn't tell you. My best guess would be some sort of security measure on her end not agreeing with some method of security on your end. Somewhere along the line, her machine disagreed with your server. On what, your guess is as good as mine. Could be anything from there only being one user for all the people you have testing to server version to, well, just about anything. If you're taking the password down, I wouldn't worry too much about it, but if you're keeping that security, it's something you might need her to post about troubleshooting.


----------



## Lulu01 (Mar 19, 2009)

Thanks, phpguy. The password protection will not be going back on the site, so I hope that's the end of the problem!


----------

