I have a problem with redirecting my website from
https://example.com to https://www.example.com
I've found a lot of advices (means rewrite rule to htaccess) on the Stack Overflow and serverfault too, but non of them works for my case.
The certificate was delivered to me for domain with www so I had to move website to such addres (cause before website was without www). The
http://example.com to https://www.example.com
works correctly.
The website is built on WordPress so I also tried to install some plugins to set up such redirection but without success.
Can anyone help me? Does somebody have an idea what can I do?
My actuall .htaccess file
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule (.*) https://www.example.com/$1 [R=301,L]
</IfModule>
# END WordPress
Please note I am the beginner so maybe the solution is very simple and obvious but well... I'm enough familiar with this topic... Please help!