I have a need to have only the home page have the following Filesmatch where .pdf files need to ask before opening up, but other .pdf files in the site (not on the home page) I want to open automatically. Is this the best way to accomplish this?
This is a Wordpress site, latest version, and the home page is a set page. Also, the owner of the site could add more .pdf links within the site so I don't want to complicate it too much where she has to manipulate code every time she adds a file.
Here is what is currently in my .htaccess file:
# Use PHP5 as default
AddHandler application/x-httpd-php5 .php
ErrorDocument 404 /index.php
ErrorDocument 403 /index.php
#BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.dramanotebook.com/$1 [R,L]
<Files 403.shtml>
order allow,deny
allow from all
</Files>
<FilesMatch "\.pdf$">
ForceType applicaton/octet-stream
Header set Content-Disposition attachment
</FilesMatch>
# END WordPress
Thanks in advance, Jim