Answers for "http to https non redirect websites"

0

redirect http non www to https www

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]

# If this does not work:
RewriteEngine On

RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]
Posted by: Guest on July-17-2020
0

http to https redirect

RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Posted by: Guest on June-13-2021

Code answers related to "http to https non redirect websites"

Browse Popular Code Answers by Language