Connect with us

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

kizinho

Published

on

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

site

Hi, Folks will show you guys how to make your users 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.

 #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 dow

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

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

 If the above step didn't work please download the zip file below that is a final bus stop to your problem inside it.

Enjoy and share 

Click Here To Comment

Download File 279bytes 131


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
7 Comments

7 Comments

  1.   greg Byd

    Coding is not working, it ended up downloading my entire website

    •  kizinho

      Can you send the screenshot on my WhatsApp 08137140110


Leave a Reply

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

Latest


Download Naijacrawl App today

Fastest way to read on the go

Download the Naijacrawl App.