htaccess not working

#1
i want to to force a file to download instead of opening in browser but with openlite speed speed its not working.

i have used

<FilesMatch "\.(mo4|mp3|)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>

also
AddType application/octet-stream mp4

also tried this one still not working

<Files *.*>
ForceType application/octet-stream
Header set Content-Disposition attachment
</Files>

i have tried everything
<FilesMatch "\.(?i:mp4|odf|pdf|rtf|txt)$">
Header set Content-Disposition attachment
</FilesMatch>


still no success
 
#5
Hi sir, i was trying to use these rewrite rules below to force download but it doesn't work.

# Force Download Files
<FilesMatch ".(?i:doc|docx|xls|xlsx|zip|mp4|rar|pdf|m4a|txt|mp3)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>

Please i don't know how to use the headers, if you can tell me how to achieve this using the right method
 

LiteCache

Active Member
#6
Hi sir, i was trying to use these rewrite rules below to force download but it doesn't work.

# Force Download Files
<FilesMatch ".(?i:doc|docx|xls|xlsx|zip|mp4|rar|pdf|m4a|txt|mp3)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>
This is not a rewrite rule, so please follow the advice of @Cold-Egg
 

Cold-Egg

Administrator
#7
@Elijah419
Try this config in the Static Context,
URI .*\.(doc|docx|xls|xlsx|zip|mp4|rar|pdf|m4a|txt|mp3)$
Location /var/www/html
Accessible Yes
Header Operations Content-Disposition attachment

Please substitute the Location to your file location.

For the AddType application part, please edit it from web admin > Server Configuration > General > MIME Settings
 
Top