redirect http to https

This commit is contained in:
Sami Samhuri 2015-05-01 08:38:04 -04:00
parent cbed64f462
commit b7e259402c

View file

@ -21,9 +21,18 @@ ExpiresDefault A259200
Header append Cache-Control "private, must-revalidate"
</FilesMatch>
################
### 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]