【发布时间】:2016-04-08 13:17:31
【问题描述】:
我试图让我的.htaccess 文件强制下载包含在网站根目录中的特定*.zip 文件。
基本上,加载我的页面时,用户将自动下载我的*.zip 文件,甚至看不到目录列表。
这是我的 .htaccess 文件:
### MAIN DEFAULTS
Options +ExecCGI -Indexes
DirectoryIndex file.zip
DefaultLanguage en-US
AddDefaultCharset UTF-8
ServerSignature Off
### FORCE FILE TO DOWNLOAD INSTEAD OF APPEAR IN BROWSER
AddType application/octet-stream .zip
AddType application/zip .zip
我可以下载该文件,但后者没有扩展名,名为download。
我该如何解决这个问题?
谢谢
-RJ
【问题讨论】:
标签: php apache .htaccess indexing download