Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache .htaccess和特定文件的HTTP头_Apache_.htaccess - Fatal编程技术网

Apache .htaccess和特定文件的HTTP头

Apache .htaccess和特定文件的HTTP头,apache,.htaccess,Apache,.htaccess,我需要以以下方式提供.crx文件: 1) The file has the content type application/x-chrome-extension 2) The file is not served with the HTTP header X-Content-Type-Options: nosniff 3) The file is served with one of the following content types: - "text/plain" - "applicat

我需要以以下方式提供.crx文件:

1) The file has the content type application/x-chrome-extension
2) The file is not served with the HTTP header X-Content-Type-Options: nosniff
3) The file is served with one of the following content types:
- "text/plain"
- "application/octet-stream"
- "unknown/unknown"
- "application/unknown"

我必须如何设置.htaccess文件才能这样做?

规则1和规则3相互矛盾。最简单的方法是将其重命名为.php并使用:

我认为您不需要.crx扩展名。如果出于某种原因,您可以使用file.php/fake.crx,而不仅仅是file.php

<? 
header('Content-Type: application/x-chrome-extension'); 
?>
...original-file-contents...