B
B
bossigorxxx2021-05-22 16:47:12
htaccess
bossigorxxx, 2021-05-22 16:47:12

Redirect from subdomain to another htaccess subdomain?

Hello! Didn't find a solution. There is a site with a bunch of subdomains. and he moves to another domain. subdomains are the same. There is some general rule not to write separately for each subdomain. there are 20 of them.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bossigorxxx, 2021-05-22
@bossigorxxx

RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.)?site\.ru$
RewriteCond %{HTTP_HOST} ^(.+)\.site\.ru$
RewriteRule (.*) http://%1.newsite .ru/$1 [R=301,L]
This helped! Maybe someone will come in handy.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question