Whenever I edit .htaccess, I get internal server error

November 17, 2013 1.9k views
I am trying to force PDFs to download and not open in user browser so I add this snippet to .htaccess but it causes internal server error. ForceType application/octet-stream Header set Content-Disposition attachment I used this code before on shared hosting. Plus I tried other snippets but it seems like when ever I edit .htaccess from console or ftp it causes internal server error. My default working .htacces with 664 permission # BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] RewriteRule . index.php [L] # END WordPress
2 Answers
Sorry, I am new to digital ocean here is the snippet again :

FilesMatch "\.(pdf)$"
ForceType application/octet-stream
Header set Content-Disposition attachment
/FilesMatch

Please pastebin the .htaccess file using the following command:
cat /path/to/.htaccess | curl -F 'sprunge=<-' http://sprunge.us
Have another answer? Share your knowledge.