404 error for PDFs

Hello,

I just uploaded a test PDF file. The file shows up as a link in the item record, but when I click on the link, I get a 404 error, specifically:

Omeka 404

"/archives/archive/files/60fd2a164160733f0c825d6a9bde0b31.pdf" is not a valid URL.

I have the docsviewer plugin installed, and the PDF does not show up in that either. This is the error message in the docsviewer:

" Sorry, we are unable to retrieve the document for viewing or you don't have permission to view the document. "

I uploaded a bitmap to a different item to test it out, and the bitmap shows up, but when I click on the image in the public view, I also get a 404 error for that.

I have also tried changing themes, but that doesn't seem to work either.

I am fairly new to Omeka, so I'm sure I'm missing something silly, but I can't figure this one out.

Here are the URLs for the items on my test site:

This is the one with the PDF:

http://www.chicopeepubliclibrary.org/archives/items/show/869

This is the one with the Bitmap:

http://www.chicopeepubliclibrary.org/archives/items/show/870

My host is Bluehost, if that matters.

Thanks,

Amber

This looks like (yet again for Bluehost lately) an .htaccess issue.

Possibly, your server is directing too many things, including these files, to Omeka for display.

This shouldn't happen with Omeka's default .htaccess file, but it's possible Bluehost or simplescripts uses a modified file. Could you post the contents of that file (it will be located in the top level of Omeka).

The other possible problem is that you don't have correct permissions for the "files" directory, but this seems less likely because you're able to upload the files without issue.

Hi, thanks for replying.

I have pasted the contents of the .htaccess file below.
I also had this problem: http://omeka.org/forums/topic/omeka-blue-host, and uploaded a new .htaccess file, which worked.

Here is my .htaccess file:

RewriteEngine on

# If know that mod_rewrite is enabled, but you are still getting mod_rewrite errors,
# uncomment the line below and replace "/admin/" with your install directory.
# RewriteBase /admin/

RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php

Thanks,

Amber

Yep, that's not the .htaccess that comes with Omeka.

Replacing your RewriteRule line with this:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d [OR]
# This ensures that Apache will not mistake the URL mysite.com/archive/ for a request for the physical directory that stores files
RewriteCond %{REQUEST_URI}  .+\/archive\/
RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php

...should solve your problem.

That definitely worked for displaying the files, but now the links for "browse items" and "browse collections" go to a generic index page: http://www.chicopeelibrary.org/archives/items/

Another weird thing is that there are two .htaccess files. One is in the admin directory and one is in the main directory for Omeka. Is that normal?

Amber

Yes, you're supposed to have two .htaccess files, one in the main directory and one in the admin directory.

(In the upcoming release of Omeka, we've combined those files into just one in the main directory, but for the 1.3 series and back, there should be two.)

As for your issue: do you happen to have directories within Omeka named "items" and "collections"? Neither of those directories should exist.

Yes, I do have directories for both "items" and "collections."

Should I just remove those? They are both empty.

Also, should both .htaccess files be the same or different?

Thanks so much for your help.

Amber

Okay, I deleted the "Collections" and "Items" directories, and it is all working now. Thanks so much for your help!

Amber