Apache .htaccess cache settings

             

RewriteEngine On RewriteBase / RewriteCond %{ENV:HTTPS} !^.*on RewriteRule ^(.*)$ https://yourdomain.com/$1 [R,L] # One year for image files <filesMatch ".(jpg|jpeg|png|gif|ico)$"> Header set Cache-Control "max-age=31536000, public" </filesMatch> # One month for css and js <filesMatch ".(css|js)$"> Header set Cache-Control "max-age=2628000, public" </filesMatch> # 480 weeks <filesMatch "\.(eot|svg|ttf|woff|woff2)$"> Header set Cache-Control "max-age=1209600, public" </filesMatch>


Apache redirect HTTP na HTTPS

             

Do sekce pro virtualhost port 80 () přidejte: RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]