【发布时间】:2014-04-20 19:17:53
【问题描述】:
我刚刚使用与生产环境中相同的代码将本地环境设置为带有 ubuntu32 的 vagrant 虚拟机,
问题是我在 .htaccess 文件中的所有规则都出现内部服务器错误
所以我开始删除单独的代码块,这就是问题所在:
# 1 weeks
<FilesMatch "\.(js|css)$">
Header set Cache-Control "max-age=604800, public"
</FilesMatch>
# 1 weeks
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=604800, public"
</FilesMatch>
# 1 MIN
<FilesMatch "\.(html|htm|php)$">
Header set Cache-Control "max-age=60, private, proxy-revalidate"
</FilesMatch>
问题是我想对所有环境使用完全相同的代码,有没有办法我只能在localhost 中不包含<filesMatch> 的那个块?
我找到了这个answer,但它只是指一个页面,而不是主机名。
【问题讨论】:
标签: apache .htaccess localhost setenv