Unable to download MS Office files from Centos 5.5 + Apache Server

Discussion in 'Apache' started by varunvats, Jul 30, 2012.

  1. #1
    Background

    We have a hosting account with a company that hosts our website on a Centos 5.5 server. We just migrated our website to a different server which still runs Centos 5.5 (change in IP address). However, after the migration we have not been able to download ANY files from the Microsoft Office family of products that are hosted on our website. Following is the message I get in Google Chrome:

    [Error 6 (net::ERR_FILE_NOT_FOUND): The file or directory could not be found.
    Code (markup):
    IE thinks it is an HTTP 400 error.


    Attempted Solution

    I spoke to the customer service and they suggested that I add the appropriate MIME types to the .htaccess file. I went ahead and added the following to the.htaccess file that exists at the root of our website:

    AddType application/vnd.ms-word.document.macroEnabled.12 docm
    AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
    AddType application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
    AddType application/vnd.ms-powerpoint.template.macroEnabled.12 potm
    AddType application/vnd.openxmlformats-officedocument.presentationml.template potx
    AddType application/vnd.ms-powerpoint.addin.macroEnabled.12 ppam
    AddType application/vnd.ms-powerpoint.slideshow.macroEnabled.12 ppsm
    AddType application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
    AddType application/vnd.ms-powerpoint.presentation.macroEnabled.12 pptm
    AddType application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
    AddType application/vnd.ms-excel.addin.macroEnabled.12 xlam
    AddType application/vnd.ms-excel.sheet.binary.macroEnabled.12 xlsb
    AddType application/vnd.ms-excel.sheet.macroEnabled.12 xlsm
    AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
    AddType application/vnd.ms-excel.template.macroEnabled.12 xltm
    AddType application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx
    Code (markup):
    However, this doesn't seem to have helped. I still get the same error message.I have tested the downloads with PDF and ZIP files and they download fine. Also, I am able to download .xlsx files using an FTP client.

    Any pointers to where the issue could be? I am comfortable editing Apache configuration files, but do not have access to Apache core configuration files as I am on shared hosting. Also, the version of Apache on the servers is 1.3.33

    Thank you,
    Varun Vats
     
    varunvats, Jul 30, 2012 IP
  2. varunvats

    varunvats Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    After much interaction with the support staff, they (actually the "Advanced Hosting Support" team) fixed the issue. They had to add the following to our .htaccess file for .xls and .xlsx file types. Something similar would be needed for other MS Office file types:

    SetEnvIf REQUEST_URI ^/(.*)/*.xls$ no-jk
    SetEnvIf REQUEST_URI ^/(.*)/*.xlsx$ no-jk
    Code (markup):

    Hope this helps someone.
     
    varunvats, Aug 4, 2012 IP
  3. MilesWeb

    MilesWeb Well-Known Member

    Messages:
    869
    Likes Received:
    36
    Best Answers:
    7
    Trophy Points:
    173
    #3
    Thanks for the share. Much appreciated. Cheers.
     
    MilesWeb, Aug 4, 2012 IP