A
A
Alex Pan2019-09-11 08:35:51
URL Handling
Alex Pan, 2019-09-11 08:35:51

How to make a redirect by a label in a link?

there is a link site.ru/?1111
how to make it so that when you go with such a referrer (1111), site1.ru opens,
if without a referrer, then site2.ru

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2019-09-13
@shambler81

RewriteCond %{HTTP_HOST} ^site\.ru$
RewriteCond %{QUERY_STRING} (^|&)1111($|&)
RewriteRule ^$ https://site1.ru/? [L,R=301]


RewriteCond %{QUERY_STRING} !(.+)
RewriteCond %{HTTP_HOST} ^site\.ru$
RewriteRule ^$ https://site2.ru/? [L,R=301]

something like this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question