V
V
Valery232019-09-05 22:45:04
htaccess
Valery23, 2019-09-05 22:45:04

How to redirect from one https domain to another https domain using .htaccess?

There is a domain: site.studio, using this code in .htaccess it redirects to site.com:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} site.studio
RewriteRule (.*) https://site.com/$1 [R=301,L]
</IfModule>

but if I switch from https://site.studiothen I get an error:

Can't access site

site.studioSSL connected to the domain . How to correctly write in .htaccess so that when https://site.studio it also redirects to https://site.com?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question