A
A
Alexey Shulmin2018-09-27 12:40:41
URL Handling
Alexey Shulmin, 2018-09-27 12:40:41

How to make a 301 redirect from all child pages to the parent?

Good afternoon. There are pages on the site (CMS Joomla):

https://www.genakom.ru/contacts
https://www.genakom.ru/o-kompanii
https://www.genakom.ru/rasprodaja

etc.
When publishing articles, CMS creates ( https://www.genakom.ru/newsour/8-newsshop/216-post...) duplicates with the above url:
https://www.genakom.ru/contacts/newsour/8-newsshop/216-postavki
https://www.genakom.ru/o-kompanii/newsour/8-newsshop/216-postavki
https://www.genakom.ru/rasprodaja/newsour/8-newsshop/216-postavki

You need to make a 301 redirect (preferably through .htaccess) of all child pages of any nesting:
https://www.genakom.ru/contacts/newsour/8-newsshop/216-postavki/newsour
https://www.genakom.ru/contacts/newsour/11-newsshop/216-postavki
https://www.genakom.ru/contacts/newsour/8-newsshop/216-postavki/216

To the parent:
https://www.genakom.ru/contacts/
I ask for help with writing the conditions. Thanks in advance

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Shulmin, 2018-09-28
@schulmin

Decision:

RewriteRule ^contacts/(.+)$ https://www.genakom.ru/contacts [R=301,L]

D
Dimonchik, 2018-09-27
@dimonchik2013

https://freelansim.ru here you can thank

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question