ExpiresActive on ExpiresByType text/html {mode}{lifetime} RewriteEngine On Explicitly prevent direct access here. This is needed because the .htaccess access check in the root dir is overwritten by the RewriteRules defined here. RewriteCond %{ENV:REDIRECT_STATUS} ^$ RewriteRule .* - [F,L] RewriteCond % >@{expires} RewriteRule ^.*$ /index.php