M
M
m4son2020-08-12 15:00:04
htaccess
m4son, 2020-08-12 15:00:04

How to correctly specify a redirect?

We made a new site, and we can’t do relinking, namely:

Redirect 301 /pesok/kvarceviy-pesok/ https://newsite.ru/pesok/

As a result, relinking goes to https://newsite.ru/pesok/kvarceviy-pesok / , that is, it adds something extra to the end

. Why is that? How to fix ?
How to make relinking strictly according to the specified link?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2020-08-12
@m4son

As a result, the linking goes to https://newsite.ru/pesok/kvarceviy-pesok/ , that is, it adds an extra to the end

So somewhere above there is a rule Redirect 301 / https://newsite.ru/and it works.
These rules can simply be reversed.
Redirect 301 /pesok/kvarceviy-pesok/ https://newsite.ru/pesok/
Redirect 301 / https://newsite.ru/

Or use RedirectMatch.
RedirectMatch 301 ^/$ https://newsite.ru/
RedirectMatch 301 ^/pesok/kvarceviy-pesok/$ https://newsite.ru/pesok/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question