D
D
draivs2019-02-12 13:17:18
htaccess
draivs, 2019-02-12 13:17:18

How to write a combined redirect in .htaccess?

Hello!
Need help with a combined redirect that is written in .htaccess ...
That is, how to write it correctly -
when you need the main page of the site with all its weight to redirect (301 Redirect) to one domain1, and the internal page of this site redirect - to completely another domain2?
It was written in the file like this -

<IfModule mod_rewrite.c>
   Options +SymLinksIfOwnerMatch
   RewriteEngine On
   RedirectMatch 301 ^(.*)$ http://www.1домен.com/
   Redirect 301 /внутр-страница http://www.2домен.com/
</IfModule>

.. but it doesn't work, because the redirect happens only to domain1..
What's wrong? How to make a record?
Thank you in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-02-12
@dodo512

RedirectMatch 301 ^/$ http://www.1домен.com/
RedirectMatch 301 ^/внутр-страница$ http://www.2домен.com/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question