Title: Evading Multiple Redirects
Last modified: June 7, 2021

---

# Evading Multiple Redirects

 *  Resolved [toshiamcbrowns](https://wordpress.org/support/users/toshiamcbrowns/)
 * (@toshiamcbrowns)
 * [5 years ago](https://wordpress.org/support/topic/evading-multiple-redirects/)
 * Hi,
 * I have a blog with post urls like
 * [https://www.example.com/apple.html](https://www.example.com/apple.html)
    [https://www.example.com/lion.html](https://www.example.com/lion.html)
 * now I am changing the URL structure to include category as well like
    [https://www.example.com/fruits/apple.html](https://www.example.com/fruits/apple.html)
   [https://www.example.com/animals/lion.html](https://www.example.com/animals/lion.html)
 * I understand permalink manager will auto redirect 301 old URL to new URL.
 * After few months I may again change the URL structure of above to include more
   subcategories like:
 * [https://www.example.com/fruits/red/apple.html](https://www.example.com/fruits/red/apple.html)
   
   [https://www.example.com/animals/carnivorous/lion.html](https://www.example.com/animals/carnivorous/lion.html)
 * And I understand permalink manager will auto redirect 301 old URL to new URL.
 * But now there are 2 redirect chains.
    1st URL >> 2nd URL >> 3rd Final URL
 * Is it possible that permalink manager automatically redirects from
    the 1st URL
   to 3rd final URL and 2nd URL also redirects to the 3rd final URL?
 * So that we can avoid 2 redirect chains.
 * Can we do this automatically instead of doing it manually one by one.
    if YES
   then how?
 * BTW it’s a wonderful plugin 🙂
 * Thanks,
    Toshi

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Maciej Bis](https://wordpress.org/support/users/mbis/)
 * (@mbis)
 * [5 years ago](https://wordpress.org/support/topic/evading-multiple-redirects/#post-14527960)
 * Hi Toshi!
 * By default, the free version of plugin will use the canonical redirect. In practice,
   my plugin will automatically redirect the original permalink (based on native
   permalink settings) to the currently used custom permalink set with Permalink
   Manager. It means that “1st URL” should always redirect to the actual URL (2nd
   URL and then later 3rd final URL).
 * However, if you would like to change the custom URL at some point (2nd URL ->
   3rd URL), the canonical URL probably will not be applied. In such situation, 
   to auto-redirect 2nd URL to 3rd URL you will need either:
    - paid version of plugin:
    - or a custom PHP snippet that would try to recognize the post by slug extracted
      from requested URL (if it leads to 404 error page):
       [https://gist.github.com/maciejbis/6fde3381a29f2e224640aa4953d9a929](https://gist.github.com/maciejbis/6fde3381a29f2e224640aa4953d9a929)
 *  Thread Starter [toshiamcbrowns](https://wordpress.org/support/users/toshiamcbrowns/)
 * (@toshiamcbrowns)
 * [5 years ago](https://wordpress.org/support/topic/evading-multiple-redirects/#post-14527972)
 * Hello Again,
 * So I understand paid plugin allows auto 301 redirect from 2nd to 3rd URL.
 * But can it also do this automatically?
 * 1st URl >> 3rd URL
    2nd URL >> 3rd URL
 *  Plugin Author [Maciej Bis](https://wordpress.org/support/users/mbis/)
 * (@mbis)
 * [5 years ago](https://wordpress.org/support/topic/evading-multiple-redirects/#post-14528038)
 * Hi [@toshiamcbrowns](https://wordpress.org/support/users/toshiamcbrowns/),
 * In free version of plugin, below variants will be covered with “canonical redirect”:
    - initially: 1st URl >> 2nd URL
    - then: 1st URl >> 3rd URL (after 2nd URL is replaced with 3rd URL)
 * In short, the canonical redirect will work like this:
    [https://permalinkmanager.pro/docs/faq/old-permalinks-redirect/#canonical-redirect-in-permalink-manager](https://permalinkmanager.pro/docs/faq/old-permalinks-redirect/#canonical-redirect-in-permalink-manager)
    - **original/native URL** => **actual custom URL** (it could be only one URL:
      either 2nd URL OR 3rd URL)
 * In free version of plugin, to make sure “2nd URL” does not return 404 error, 
   after you finally change the custom permalink to “3rd URL”, you will need a custom
   PHP snippet:
    [https://gist.github.com/maciejbis/6fde3381a29f2e224640aa4953d9a929](https://gist.github.com/maciejbis/6fde3381a29f2e224640aa4953d9a929)
 * —————-
 * The paid version allows to save the old permalinks as “extra redirects” after
   the custom permalinks are updated:
    [https://permalinkmanager.pro/docs/plugin-settings/old-custom-permalinks-redirect/](https://permalinkmanager.pro/docs/plugin-settings/old-custom-permalinks-redirect/)
 * For instance, after you replace “2nd URL” with “3rd URL”, Permalink Manager Pro
   will save “2nd URL” as “extra redirect” that would work like an alias for that
   specific post.
 * I hope the above is useful to you. If you require any further information, feel
   free to contact me.
 * Best regards,
    Maciej
    -  This reply was modified 5 years ago by [Maciej Bis](https://wordpress.org/support/users/mbis/).
    -  This reply was modified 5 years ago by [Maciej Bis](https://wordpress.org/support/users/mbis/).
 *  Thread Starter [toshiamcbrowns](https://wordpress.org/support/users/toshiamcbrowns/)
 * (@toshiamcbrowns)
 * [5 years ago](https://wordpress.org/support/topic/evading-multiple-redirects/#post-14528290)
 * Thanks, I got your point. I Would be interested in getting the paid plugin.
 * Just a couple of doubts related to this statement.
 * <<For instance, after you replace “2nd URL” with “3rd URL”, Permalink Manager
   Pro will save “2nd URL” as “extra redirect” that would work like an alias for
   that specific post.>>
 * My queries:
 * 1- so in the paid plugin,
    the 1st URL will auto redirect to 3rd URL and the 
   2nd URL will redirect to 3rd URL as well.
 * Is this done automatically for all the posts?
 * 2 – now multiple redirect chains will not be there?
    ie 1st to 2nd and then 2nd
   to 3rd
 * Sorry for so many questions.
 *  Plugin Author [Maciej Bis](https://wordpress.org/support/users/mbis/)
 * (@mbis)
 * [5 years ago](https://wordpress.org/support/topic/evading-multiple-redirects/#post-14528341)
 * Hi [@toshiamcbrowns](https://wordpress.org/support/users/toshiamcbrowns/),
 * No problem at all 🙂 The redirect chain/loop will not be the case here – my plugin
   will always use the canonical URL as a target URL (so in your case 1st URL will
   directly redirect to 3rd URL).
 * In order to make the paid plugin redirect the “intermediate” URL (2nd URL) you
   will need to make my plugin save the 2nd URL as “extra redirect” by enabling “**
   Save old custom permalinks as extra redirects**” option in Permalink Manager 
   settings:
 * As long as “**Save old custom permalinks as extra redirects**” option is turned
   on, all the old permalinks will automatically be saved as redirects. This applies
   to both individual permalink adjustments or bulk changes (with “Permastructures”&“
   Regenerate/reset” tool).
 * Best regards,
    Maciej
 *  Thread Starter [toshiamcbrowns](https://wordpress.org/support/users/toshiamcbrowns/)
 * (@toshiamcbrowns)
 * [5 years ago](https://wordpress.org/support/topic/evading-multiple-redirects/#post-14528423)
 * Wonderful.
    This is what I wanted. You were so helpful, definitely trying my 
   hands on the paid version 🙂

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Evading Multiple Redirects’ is closed to new replies.

 * ![](https://ps.w.org/permalink-manager/assets/icon.svg?rev=2625166)
 * [Permalink Manager Lite](https://wordpress.org/plugins/permalink-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/permalink-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/permalink-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/permalink-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/permalink-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/permalink-manager/reviews/)

## Tags

 * [multiple redirects](https://wordpress.org/support/topic-tag/multiple-redirects/)

 * 6 replies
 * 2 participants
 * Last reply from: [toshiamcbrowns](https://wordpress.org/support/users/toshiamcbrowns/)
 * Last activity: [5 years ago](https://wordpress.org/support/topic/evading-multiple-redirects/#post-14528423)
 * Status: resolved