Redirecting to attachment pages of the same name

There are two problems here. One of them is related to the WordPress canonical redirect, while the other is not.

I will try to go over them once again, so some of the information may be repeated, but please take the time to read and analyze everything carefully.

#1 Relative URLs:

To clarify, the first problem is that you use the relative URLs instead of absolute ones.

<a href="https://projectdmc.org/support/topic/redirecting-to-attachment-pages-of-the-same-name/nalogovye-spory">предприятиями</a>

As I explained earlier, this may to seem correctly at the first glance, but because this URL is relative, the browser will convert this relative URL to absolute one. You can clearly see this final URL if you hover that link:

As long as the link is “nalogovye-spory“, the browser will convert it to incorrect URL (with parent slug included):

https://www.new.gorodprava.ru/yuridicheskim-liczam/nalogovye-spory/

This has nothing to do with WordPress or Permalink Manager, this is how the relative links are parsed by browsers. There is really no other option than:

#2 WordPress & Permalink Manager

Actually, you have managed to remove the parent slugs from the child pages. It seems that you have also adjusted the plugin settings, because now I see that the plugin’s redirect is working as intended:

https://permalinkmanager.pro/docs/plugin-settings/canonical-redirects/#5-how-does-canonical-redirect-affects-custom-permalinks

For instance, the new permalink for “Налоговые споры” seems to be correctly changed from:

https://www.new.gorodprava.ru/yuridicheskim-liczam/nalogovye-spory/

to:

https://www.new.gorodprava.ru/nalogovye-spory

Now, whenever a visitor tries to open the original URL (the one with the parent slug), Permalink Manager will automatically redirect it to the canonical custom permalink (the one without the parent slug).

  • This reply was modified 1 hour, 17 minutes ago by Maciej Bis.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer