This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Firefox can't open PDF links that have been rewritten in .htcaccess

  • 2 replies
  • 3 have this problem
  • 1 view
  • Last reply by SsjCosty

more options

I have a Wordpress multi-site, and my problem is that Firefox can't open any of the PDFs that I have there. I get a dark-gray screen and it says "This PDF document might not be displayed correctly", but I am able to download it. In .htaccess I have this rewrite rule for files: RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

The thing is that if I write the actual path to the file it opens it in preview just fine. Also, Chrome and IE don't have this problem.

I have a Wordpress multi-site, and my problem is that Firefox can't open any of the PDFs that I have there. I get a dark-gray screen and it says "This PDF document might not be displayed correctly", but I am able to download it. In .htaccess I have this rewrite rule for files: RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L] The thing is that if I write the actual path to the file it opens it in preview just fine. Also, Chrome and IE don't have this problem.

All Replies (2)

more options

Hello,

In order to change the default reader for PDF files (to not open PDF files with Firefox's internal PDF reader), follow these steps:

  1. Go to Tools > Options (or Firefox > Options).
  2. In the Options window, select the Applications tab.
  3. In the Search field, type PDF. You should find Portable Document Format (PDF).
  4. On the right handside you should find an Action column. Use that to select your favorite PDF reader. In order to view PDF files in Firefox, choose Preview in Firefox.

Did this fix your problems? Please report back to us!

Thank you.

more options

Hello,

Thanks for the suggestion, but it's not exactly what I'm looking for. My clients and other people experience the same issue on my site, and I don't think I can make them change their settings.

My problem is that even though the setting is Preview in Firefox, the browser just can't seem to be able to open it. But it is because I have that url rewrite line, whereas if I link to the PDF's actual path (without the rewrite) it opens it just fine. And I would like to keep the rewrite and have it working at the same time.