I have a domain.co and just bought domain.com and want to use SSL on it.
Having in mind this H5BP apache config for HTTP to HTTPS redirect:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
Once in place, will it automatically start redirecting all HTTP pages from domain.co to HTTPS pages on domain.com or I have to modify rule to something like this or similar?
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://domain.com/$1 [R=301,L]
</IfModule>
The former will not work, as it will merely rewrite the URL to https and do nothing to the host. The latter in your example should correctly rewrite to https as well as the domain specified whilst requesting the originally requested resource. Only one way to be sure though - try it and find out!