Answer the question
In order to leave comments, you need to log in
How to prohibit a redirect from one domain, but allow it from another if there is only one site and a common htaccess?
Faced a problem:
There are 3 domains, let's say a, b, c.
A and B are different domains, but the same site. C is a new standalone site. Goal: set up a 301 redirect from the pages of site B to C, while ensuring that there are NO redirects from A. Since htaccess is shared, when writing instructions they work from two domains. In an inexperienced head, this looks like creating some kind of host check condition before redirects, but I don’t know exactly how to do this. Please help.
I did the redirects themselves like this, and they work, but unfortunately for both sites at once
RewriteCond %{REQUEST_URI} ^/catalog/krovlya/$
RewriteRule ^.*$ https://site.ru/catalog/krovlya/? [R=301,L]
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