3 Replies Latest reply: Apr 21, 2014 12:26 PM by hans-g. RSS

    Help!  Trying to edit .htaccess to allow PDF?

    pbsum83 Community Member

      Hello,

       

      I am having trouble editing my .htaccess file to allow users of my site to click and download PDF files without .htaccess blocking it and showing a 'Page Not Found' error.

       

      Here is my code:

       

      <IfModule mod_rewrite.c>

      RewriteEngine On

      RewriteBase /

      RewriteRule ^index\.php$ - [L]

      RewriteCond %{REQUEST_FILENAME} !-f

      RewriteCond %{REQUEST_FILENAME} !-d

      RewriteRule . /index.php [L]

      </IfModule>

       

      <Files ~ "\.(pdf)$">

         order deny,allow

         allow from all

      </Files>

       

      <FilesMatch "\.(?i:pdf)$">

           ForceType application/octet-stream

           Header set Content-Disposition attachment

      </FilesMatch>