How to do a redirect automatically on the full URL?

Hi.


The question is:


I have a domain xxx.ru and yyy.ru


xxx.ru — the main and the meat of the site, yyy.ru — support in case of errors. So I want full redirect reference.


Why? Because the links I have a very CNC and you can even use the search on the site. Just entered in the URL name and all.


Now I want if the visitor has entered yyy.ru/marker.html that would get it on xxx.ru/marker.html


Tried a normal redirect sablonai in the end, it redirects, but xxx.rumarker.html

Ie / removed automatic. How to make my URLs were active at both addresses?


Tried RedirectMatch — did not work I might have done.
October 8th 19 at 01:26
2 answers
October 8th 19 at 01:28
If opachevskogo mod_rewrite, then here it is:

RewriteCond %{HTTP_HOST} yyy.ru
RewriteRule (.*) http://xxx.ru/$1 [R=301,L]
October 8th 19 at 01:30
does not work, sculpts without the slash, as in the case of RedirectMatch...
To begin with, insert before $1 any letter and see if she appears in redirectout the address to make sure that this redirect is triggered, and not some else. If does not help, write more versions, what and where to prescribe. - Ursula.Schamberg commented on October 8th 19 at 01:33
I tried... didn't work again. Write in .htaccess

The Version Of Apache 2.2.x
mod_rewrite Is - maia.Johnst commented on October 8th 19 at 01:36
yet for some reason redirects to www - maia.Johnst commented on October 8th 19 at 01:39

Find more questions by tags Apache