V
V
valrock95012017-03-03 21:07:44
htaccess
valrock9501, 2017-03-03 21:07:44

Redirect in .htaccess from http + www to https + www?

the site already has a redirect to www

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

you need to set another redirect to https

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2017-04-14
@shambler81

RewriteEngine on
RewriteCond %{HTTP} On
RewriteCond %{HTTP_HOST} !^www.(.+) [NC]
RewriteRule (.*) https://www.%{HTTP_HOST}/$1 [R=301,L]

I think it's obvious.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question