Answer the question
In order to leave comments, you need to log in
What directive should be specified in .htaccess to redirect from one site section to another site section?
Good afternoon.
There are two sites old "A" and new "B". Please tell me what directive to write in .htaccess so that the visitor, getting into one section of the site "A" (glossary), is automatically redirected to the section of the site "B" (glossary). Those. so that, respectively, from the material located in the section of the old site "A" was also redirected to the section of the new site "B"?
In this case, the weight of the material is transferred? What other pitfalls and disadvantages with this approach, if such a redirect is possible at all?
Found this:
RewriteRule ^m(/.*|)$ catalog$1 [L,NC,R=301]
Another option:
RewriteEngine On
RewriteRule ^catalog/(.+)$ /cat/$1 [L,R=301]
or
RewriteRule ^(.+/)*catalog/(.+)$ $1cat/$2 [L,
Which of the three options is correct?
Answer the question
In order to leave comments, you need to log in
everything works fine for me with these parameters
includes redirecting
RewriteEngine on
from where
RewriteCond %{HTTP_HOST} ^site.ru$ [NC]
to
RewriteRule ^(.*)$ new site/article [R=301,L]
and to robots.txt set the main host and map of the new site
User-agent: Yandex
Host: new site.ru
User-agent: *
Disallow:
Sitemap: new site/sitemap.xml
According to Yandex, this method transfers 99% of the
upd weight.
For .htaccess there will be this solution
RewriteEngine On
RewriteRule ^старый/(.+)$ /новый/$1 [L,R=301]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question