Connect with us

How to Force Download Any Files On Your Wordpress Site Using Htaccess (mp3,mp4,pdf etc)

kizinho

Published

on

Follow
How to Force Download Any Files On Your Wordpress Site Using Htaccess (mp3,mp4,pdf etc)
Photo: Naijacrawl

Hi, Folks will show you guys on how to make your users to download any file on your Wordpress Site, without using any plugin.

 

In other to achieve this we will use htaccess

 

Log in to your Cpanel, Navigate to File Manager 

 

Go to Public_html 

 

At the right top of the menu, click on settings and thick show hidden files.

 

Locate a file named .htacces and use edit to add this code 

 

#my force download ,mp3 and mp4

AddType application/octet-stream .mp3
AddType application/octet-stream .mp4



ForceType applicaton/octet-stream

Header set Content-Disposition attachment



ForceType applicaton/octet-stream

Header set Content-Disposition attachment



#end of force download

 

This setup is only for mp3 and mp4, you can extend it by adding for files extensions like .pdf, etc.

 

Enjoy and share 



kizinho
 Follow

I am a software developer, like meeting people and love blogging, that's why I developed naijacrawl because that's what I love doing.

Continue Reading
3 Comments

3 Comments

  1.   It worked for me too

    Thanks for the info. It worked for me also. Checkout my blog. https://9jacase.com


  2.   Easy4lord

    Thanks so much bro I would like to reach you



    https://9jadailyinfo.com.ng


  3.   Smartslimhub@gmail.com

    Worked perfectly .



    Really helpful and well explained.



    Check out my blog



    https://Smartslimhub.com



Leave a Reply

Your email address will not be published. Required fields are marked *

Latest



Face of Naijacrawl


ChukwubuikemSunday ChukwubuikemSunday

Sunday Chukwubuikem


Higher - 09061773292

Trending