Connect with us

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

kizinho

Published

on

Follow
NEWS: How to Force Download Any Files On Your Wordpress Site Using Htaccess (mp3,mp4,pdf etc) [New  Developer] » Naijacrawl
Photo: Naijacrawl
site

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 

Click Here To Comment


site


kizinho

Adike Kizito is a top-rated software developer, blogger, sports, and entertainment lover. He is the CEO of these popular websites Naijacrawl.com and Mp3ager.com. He operates his software developing task through Kizzsoft.com,... Read More

Continue Reading
17 Comments

17 Comments

  1.   Naija Studio

    Thanks for sharing I use it on this site

    Check it

  2.   Mbam Stanley

    Nice updates, Boss keep it up, I love this kind of Post.

    Check Out The Following

    Entertainment Portal

  3.   Ahmmed Ale

    Thanks for this... This is not bad

    Wiseloaded

  4.   Kunle

    Thanks for this... Tested and it's okay

    Check Out This

  5.   Son Of God

    Nice one. Thanks for the sharing.
    Eduwapaz

    •  kizinho

      Thanks for your feedback, will always give out more


Leave a Reply

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

Latest