I recently found out a problem in .htaccess file in my website. When I started the site I did a 301 redirect to redirect all non-www and http request to www with https. I added this lines of code and it worked very well.RewriteCond %{SERVER_PORT} 80 [OR]RewriteCond %{HTTP_HOST} !^www\.RewriteRule (.*) https://www.example.com/$1 [R=301,L]Also I submitted all 4 variants of my urls to google webmaster tools. I saw they have used https://www in search engine results as well. Then later when I tried to edit the .htaccess code there were no any rule I previously added. But the redirect still worked as it should.Is this normal? I didn't use <IfModule mod_rewrite.c> tags when adding the code. Is it okay or should I add those opening and closing tags and add it again?
Properly redirect a site to WWW and HTTPS
htaccess;301 redirect;https;mod rewrite