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 

site


kizinho

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

16 Comments

  1.   Mbam Stanley

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

    Check Out The Following

    Entertainment Portal

  2.   Ahmmed Ale

    Thanks for this... This is not bad

    Wiseloaded

  3.   Kunle

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

    Check Out This

  4.   Son Of God

    Nice one. Thanks for the sharing.
    Eduwapaz

    •  kizinho

      Thanks for your feedback, will always give out more

  5.   DJ Maphorisa

    Nice one. Thanks for this
    SureLoaded

  6.   SureLoaded

    Nice one, keep up the good work.
    Working perfectly https:/sureloaded.net

    •  kizinho

      Thanks for your feedback, will always give out more

  7.   greg Byd

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

    •  kizinho

      Can you send the screenshot on my WhatsApp 08137140110

  8.   It worked for me too

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


    •  kizinho

      Thanks for your feedback, will always give out more

  9.   Easy4lord

    Thanks so much bro I would like to reach you



    https://9jadailyinfo.com.ng


    •  kizinho

      Thanks for your feedback, will always give out more

  10.   Smartslimhub@gmail.com

    Worked perfectly .



    Really helpful and well explained.



    Check out my blog



    https://Smartslimhub.com


    •  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