将Apache.htaccess转换为Lighttpd和mod_头文件

将Apache.htaccess转换为Lighttpd和mod_头文件,.htaccess,lighttpd,mod-access,.htaccess,Lighttpd,Mod Access,我已经开始使用Lighttpd,我有一个.htaccess文件,它改变了响应头 <IfModule mod_headers.c> Header unset Content-Type Header unset Content-Disposition Header set Content-Disposition attachment Header set Content-Type application/octet-stream Header ad

我已经开始使用Lighttpd,我有一个
.htaccess
文件,它改变了响应头

<IfModule mod_headers.c>
    Header unset Content-Type
    Header unset Content-Disposition
    Header set Content-Disposition attachment
    Header set Content-Type application/octet-stream
    Header add Content-Type application/force-download
    Header add Content-Type application/download
    Header unset Content-Transfer-Encoding
    Header set Content-Transfer-Encoding binary
</IfModule>

标题未设置内容类型
标题未设置内容处置
标题集内容处置附件
标题集内容类型应用程序/八位字节流
标题添加内容类型应用程序/强制下载
标题添加内容类型应用程序/下载
标题未设置内容传输编码
标题集内容传输编码二进制

如何将其转换为在Lighttpd中工作?

您需要使用以下内容:

setenv.add-response-header = ( "Content-Disposition" => "attachment" )
setenv.add-response-header = ( "Content-Type" => "application/octet-stream" )
setenv.add-response-header = ( "Content-Transfer-Encoding" => "binary" )
我想你是想强制下载文件,而不是在浏览器中显示文件?如果是这种情况,则根据RFC 2046()只需要应用程序/八位字节流MIME类型

'对于接收“应用程序/八位字节流”实体的实现,建议的操作是简单地提供将数据放入文件中,任何内容传输编码都将撤消,或者可能将其用作用户指定进程的输入。'