我正在使用以下规则在htaccess中:
AddType SCHM wsc
<FilesMatch "\.(wsc)$">
ForceType SCHM
Header set Content-Disposition attachment
</FilesMatch>
既然问题已经在评论中得到了回答,这里只是按照Stackoverflow指定的方式提供答案。
与问题中一样,可以通过使用Apache 2的mod_headers来解决。由于Content-Disposition
不是HTTP标准的一部分,您可以添加其他头文件来实现您的目标。
<FilesMatch "\.(wsc)$">
Header set Content-Type application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>
Header set X-Content-Type-Options "nosniff"
http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1
Content-Type
设置为application/octet-stream
。我认为可以这样写:Header set Content-Type application/octet-stream
。 - JojOatXGMEtouch <filename>
来更改时间戳。 - JojOatXGME