RewriteEngine On # rewrite jim.2martens.de to 2martens.de RewriteCond %{SERVER_NAME} ^jim\.2martens\.de [NC] RewriteRule ^(.*)$ https://2martens.de/$1 [L,R=301] RewriteCond %{HTTPS} !=on RewriteCond %{ENV:HTTPS} !=on RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] # custom 404 error page ErrorDocument 404 /404.html # sets cache header for most static files, max-age is set to one day Header set Cache-Control "max-age=86400, public"