A
A
Andrey2016-06-10 03:00:28
PHP
Andrey, 2016-06-10 03:00:28

Is it possible to redirect only from the main page without affecting child pages?

Tell me if it is possible to redirect only from the main page of the site (for example, from www.test.ru to another site www.toster.ru), but from its child pages (for example, from www.test.ru/news/ or www.test. ru/news.php?id=32) so that there is no redirect. Thank you.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Sergey, 2016-06-10
@gangstarcj

Normal 301 redirect

A
Andrey Burov, 2016-06-10
@BuriK666

RewriteRule ^/$ http://example.org/ [L,R=301]

A
Andrey, 2016-06-10
@andreyk0

no, it doesn't work now, I'll look into it in detail, maybe I'm doing something wrong,
RewriteEngine On
RewriteRule ^/$ example.org [L,R=301]

A
Alexander Karabanov, 2018-09-08
@karabanov

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*)$ example.org [L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question