Answer the question
In order to leave comments, you need to log in
How to redirect all subdomain pages to domain pages?
We need a redirect from a subdomain to a domain. It translates to the main page, but not to the pages. Tried like this:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^msk.site.ru$ [NC]
RewriteRule ^(.*)$ https://site.ru/$1 [R=301,L]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.|)msk\.site\.ru [NC]
RewriteRule ^(.*)$ https://site.ru/$1 [R=301,L]
RewriteEngine On
RewriteCond %{HTTP_HOST} msk\.site\.ru$ [NC]
RewriteRule ^ https://site.ru%{REQUEST_URI} [R=301,L,NE]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question