Answer the question
In order to leave comments, you need to log in
How to make such a redirect?
There are four domains: site.ru, www.site.ru and site.su, www.site.su.
How to make a redirect from ru domain to su, taking into account www as well?
The option for the htaccess file is suitable. Thanks in advance.
Answer the question
In order to leave comments, you need to log in
On site.ru you redirect to site.su
On www.site.ru you redirect to www.site.su
.htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^site.ru$ [NC]
RewriteRule ^(.*)$ https://site.su/$1 [R=301,L]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.site.ru$ [NC]
RewriteRule ^(.*)$ https://www.site.su/$1 [R=301,L]
</IfModule>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.+\).ru$ [NC]
RewriteRule ^(.*)$
https ://%1.su/$1 [R=301,L]
ps
no state
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question