diff --git a/source/.htaccess b/source/.htaccess.erb similarity index 58% rename from source/.htaccess rename to source/.htaccess.erb index 9019d41..f0f0258 100644 --- a/source/.htaccess +++ b/source/.htaccess.erb @@ -1,5 +1,6 @@ --- noindex: true +layout: false --- # Compress files on the fly AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript text/javascript @@ -17,4 +18,8 @@ RewriteEngine On # Require SSL RewriteCond %{HTTPS} !=on RewriteCond %{ENV:HTTPS} !=on -RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] +RewriteRule .* https://<%= URI.parse(casper[:blog][:url]).host %>%{REQUEST_URI} [R=301,L,QSA] + +# Ensure we only use the canonical hostname +RewriteCond %{HTTP_HOST} !=<%= URI.parse(casper[:blog][:url]).host %> [NC] +RewriteRule .* https://<%= URI.parse(casper[:blog][:url]).host %>%{REQUEST_URI} [R=301,L,QSA]