1
votes

I want to redirect a non-www and a www - site to https:// with www, how can I do this using htaccess-module.

Thanks, Dako314

Edit: This does only work for the non-www-site:

RewriteCond %{HTTP_HOST} ^example.de$ [NC]

RewriteRule (.*) https://www.example.de/$1 [R=301,L]

1

1 Answers

0
votes

This might help you to redirect both example.com and www.example.com to https://www.example.com. If any problem, ask me in the comment section of this answer.

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

Thanks.