sailus
3/30/2016 - 5:28 AM

from www to non-www Rewrite HTTP to HTTPS

from www to non-www Rewrite HTTP to HTTPS

RewriteEngine On

# Rewrite from www to non-www
RewriteCond %{HTTP_HOST} ^www\.(.*)
RewriteRule (.*) http://%1/$1 [R,L]

# Rewrite HTTP to HTTPS
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]