Firefox can't open PDF links that have been rewritten in .htcaccess
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.
ყველა პასუხი (2)
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:
- Go to Tools > Options (or Firefox > Options).
- In the Options window, select the Applications tab.
- In the Search field, type PDF. You should find Portable Document Format (PDF).
- 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.
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.