Answer the question
In order to leave comments, you need to log in
Multisite in Drupal 7. How to redirect from subdomain name.site.ru to name.ru?
There is a main site - site.ru All sites are stored in the sites
directory .
In this directory, for each site, a folder of the form name.site.ru is created , and a line of the form is written in the sites.php file . When
the site is opened at the address name.site.ru, name.site.ru opens.
When you open the same site at name.ru, name.ru opens. How to redirect from name.site.ru to name.ru?
(For the subdomain to fully refer to the domain)
The sites/name.site.ru/ directory contains the settings.php file and the files , modules , themes folders .$sites['name.ru'] = 'name.site.ru';
As far as I understand, the way to register a redirect in .htaccess to the root is not suitable, because. this is for the single site case.
I suppose that it might be worth creating a .htaccess file in the folder of a specific site (for example, in sites/name.site.ru ). I tried to do this, but the redirect didn't work, it just turned off the css styles.
Help me please. This factor already hinders SEO on several sites.
Answer the question
In order to leave comments, you need to log in
It worked! I found .htaccess in the root, inserted after
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^armadio.vtopmaster.ru
RewriteRule (.*) http://armadio-dv.ru/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^dalrezerv.vtopmaster.ru
RewriteRule (.*) http://chelovekpesok.ru/$1 [R=301,L]
Can you clarify?
When you open a site at name.site.ru, does the directory sites/name.site.ru/ open?
When you open a site at name.ru, does the directory sites/name.site.ru/ open?
____________________________________________________
Check if there is an .htaccess file in the root directory of site.ru.
If the file exists, then add the following lines to the mod_rewrite () section in it
RewriteCond %{HTTP_HOST} ^name.site.ru
RewriteRule (.*) http://name.ru/$1 [R=301,L]
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^name.site.ru
RewriteRule (.*) http://name.ru/$1 [R=301,L]
</IfModule>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question