Internal server error after editing .htaccess in CakePHP
I want to disable the browser cache for CSS, images and scr开发者_如何学Cipts by adding this code to webroot/.htaccess
file:
<FilesMatch "(.)*.(css|js|jpg|jpeg|gif|png)$">
Header set Cache-Control "max-age=1"
</FilesMatch>
This is the error:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
When I add a command to every .htaccess
file in CakePHP, I receive this error!
Use FilesMatch:
<FilesMatch "\.(css|js|jpg|jpeg|gif|png)$">
Improved (note I removed "jpg"):
<FilesMatch "\.(css|js|jpe?g|gif|png)$">
精彩评论