Add .htaccess force download in lighttpd

This is how you can modify your /etc/lighttpd/lighttpd.conf to enable htaccess to force download to spesific file


#vim /etc/lighttpd/lighttpd.conf

add this line to config


## add force download for url DOM
$HTTP["url"] =~ "(.*)\google_open_visual_lab.mp4" {
mimetype.assign = (".mp4" =>"application/octet-stream")
setenv.add-response-header = ( "Content-Disposition" => "attachment" )
}
$HTTP["url"] =~ "(.*)\google_open_hazard_university.mp4" {
mimetype.assign = (".mp4" =>"application/octet-stream")
setenv.add-response-header = ( "Content-Disposition" => "attachment" )
}

ketika file ini menyentuh server kamu maka file ini tidak di stream tapi di download oleh browser.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s