Are you using WordPress and looking for the best method which user can download files from your website, today I’m going to show your step by step on how to add auto downloading features to your WordPress website via Htaccess.
The word htaccess mean Hypertext access this are hidden files used to configure additional features for website hosted on Apache Web Server, with this you call allow or disallowed access on some specific page of your website.
In other to enable direct download feature on WordPress Website for your user to download any media files read carefully and follow the step below.
Step by Step: How To Force Download Media Files On WordPress Website.
- Login WordPress Cpanel
- Click File Manager
- Open Public_html folder
- Make sure, all Hidden files should be visible
- Open .htaccess file
- Copy and paste the below code on your .htaccess file
<FilesMatch ".(mov|mp3|jpg|pdf|mp4)$"> ForceType application/octet-stream Header set Content-Disposition attachment </FilesMatch>
- Save it.
I hope this article is helpful, if you are facing error on this, feel free to drop your comment below, we are always here to provide solution.If you have any question, feel free to use the comment box below and ask us. We will respond as soon as we can.
please don’t forget to share this page with your friends using social share button below.