WordPress.org

Ready to get started?Download WordPress

Forums

PDF mime-type in WordPress Multisite (3 posts)

  1. expromo
    Member
    Posted 1 year ago #

    Hi guys!

    I have a problem with WordPress Multisite and PDF mime-types. I have a network with 2 blogs. The first (main) blog uploads it's files to /wp-content/uploads/ and I have put a .htaccess file inside the /uploads/ directory that contains the proper mime-type to force PDF file download:

    :Location *.pdf
    	SetMime application/octet-stream
    :Location

    The problem is that I cannot set this for multisite blogs as the file address is dynamic. They are uploaded to /wp-content/blogs.dir/2/files and their download path is {SECOND BLOG DOMAIN DOMAIN}/files/filename.pdf.

    I have put a similar .htaccess file in both /wp-content/blogs.dir/ and /wp-content/blogs.dir/2/files/ but it doesn't work.

    How can I solve this issue to force download PDF files on both sites?

  2. You should be able to put this in your .htaccess in the main WP folder (i.e. the one in the same folder as wp-config):

    AddType application/octet-stream .pdf
  3. expromo
    Member
    Posted 1 year ago #

    I have tried this solution and it doesn't work for me. My provider uses a different htacess structure but even if I put the correct one:

    :Location *.pdf
    	SetMime application/octet-stream
    :Location

    It still only works for the main blog and not the mu-sites. I asked the provider for help and they told me that this is a WordPress problem and I need to change WordPress config :(

Topic Closed

This topic has been closed to new replies.

About this Topic