仅在某个目录中的文件上将 Content

编程入门 行业动态 更新时间:2024-10-10 17:25:24
本文介绍了仅在某个目录中的文件上将 Content-Disposition 标头设置为附件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在我的 htaccess 文件中有这条规则来强制下载链接的文件而不是在浏览器中打开:

I've got this this rule in my htaccess file to force linked files to download rather than open in the browser:

<FilesMatch ".(gif|jpe?g|png)$"> ForceType application/octet-stream Header set Content-Disposition attachment </FilesMatch>

有没有办法改变 RegExp 使其仅适用于某个目录中的文件?

Is there a way to alter the RegExp so it only applies to files in a certain directory?

谢谢

推荐答案

您可能需要将指令放在特定目录的 .htaccess 文件中.

You will probably need to put the directives in the .htaccess file in the particular directory.

更多推荐

仅在某个目录中的文件上将 Content

本文发布于:2023-10-10 09:30:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1478304.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:上将   文件   目录中   在某个   Content

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!