我在哪里放置ExpiresDefault指令?我正在使用CodeIgniter

时间:2011-04-06 22:20:27

标签: apache caching codeigniter

我正在关注高性能网站的书籍,建议是这样做:

<FilesMatch "\.(gif|jpg|js|css)$">
  ExpiresDefault "access plus 10 years"
</FilesMatch>

无论如何我要把它放在哪里?我正在使用COdeIgniter。我可以访问我的httpd.conf文件。

1 个答案:

答案 0 :(得分:3)

您实际应该将其放在网站根目录的.htaccess文件中。

此外,您可以将它放在httpd.conf中的<Directory></Directory>块中,但在我看来,.htaccess可能会更好。

相关问题