dro59505
dro59505
2014-09-17 16:16

htaccess打开php文件作为下载

i have had a search around but haven't been able to find a similar problem.

When i add the following to my htaccess file (i want to restrict upload types to my server)

ForceType application/octet-stream
Header set Content-Disposition attachment

<FilesMatch "(?i)\.(doc?x|txt|xls?x|csv|pdf|ppt?x|zip|gif|jpe?g|png)$">
ForceType none
Header unset Content-Disposition
</FilesMatch>

Header set X-Content-Type-Options nosniff

I then refresh my page it then opens the download dialog box instead of showing the php page. I though it might be the deflate mod compressing the htaccess onto 1 line but im not so sure now.

could anyone point me in the right direction?

Thanks

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • dougan1465 dougan1465 7年前

    Thanks to the comments above i have sorted the problem. it was my mistake

    点赞 评论 复制链接分享