How can I redirect all sites pages from an old domain name to a new domain name using 301 code. I have used the following code: Using this code I could redirect the old domain pages to the new domain pages except that it is not working with HTTPS pages. So, how can I redirect the HTTPS pages from the old domain to the HTTPS of the new domain?
SSL requests go through different port than http. If it's set e.g. to 443, just use RewriteCond %{SERVER_PORT} !443 Code (markup): and then redirect requested path to the new https url.