From b7e259402c3b3312da8ea5c548d780972f6dee3d Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Fri, 1 May 2015 08:38:04 -0400 Subject: [PATCH] redirect http to https --- public/.htaccess | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/public/.htaccess b/public/.htaccess index 035ac4e..20b0841 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -21,9 +21,18 @@ ExpiresDefault A259200 Header append Cache-Control "private, must-revalidate" + +################ +### Rewrites ### +################ +RewriteEngine On + +# Redirect http to https +RewriteCond %{HTTPS} off +RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} + # Make super old posts redirect properly. # e.g. http://sami.samhuri.net/2007/6/23/emacs-for-textmate-junkies -RewriteEngine On RewriteRule ^posts/([0-9][0-9][0-9][0-9])/([0-9])/[0-9]/(.*)$ /posts/$1/0$2/$3 [R=301] RewriteRule ^posts/([0-9][0-9][0-9][0-9])/([0-9])/[0-9][0-9]/(.*)$ /posts/$1/0$2/$3 [R=301] RewriteRule ^posts/([0-9][0-9][0-9][0-9])/([0-9][0-9])/[0-9]/(.*)$ /posts/$1/$2/$3 [R=301]