B
B
blink12021-07-25 10:29:35
HTML
blink1, 2021-07-25 10:29:35

How to create a redirect rule from all domain pages except the main page?

Hello!
Can you suggest how to create a rule so that all site users who have NOT visited the main page of the site are moved to a similar page on a different domain.

Example:
The user goes to site.ru , he stays on the page.
If he went from somewhere to the address site.ru/page.html, then he is transferred to site2.ru/page.html

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Egor Danchenko, 2021-07-25
@blink1

RewriteEngine On
RewriteCond %{REQUEST_URI} !=/
RewriteRule (.*) https://site2.ru/$1 [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question