Archive From custom post redirect to a media file by permalink manager

Thread Starter
cryoth

(@cryoth)

Hello,

thanks for the quick response, here are the screenshots for the different links :

Debug_url :

Array
(
    [uri_parts] => Array
        (
            [lang] => 
            [uri] => maison-cubique
            [endpoint] => 
            [endpoint_value] => 
        )

    [old_query_vars] => Array
        (
            [post_type] => maisoncubique
        )

    [new_query_vars] => Array
        (
            [attachment] => maison-cubique
            [do_not_redirect] => 1
        )

    [pm_query] => 5719
    [content_type] => Post type: attachment
    [version] => 2.2.20.3
)

Debug redirect :

This link redirect me immediatly to https://www.piraino.fr/wp-content/uploads/2022/11/maison-cubique-scaled.jpg

Debug WP Redirect :

Array
(
    [url] => https://www.piraino.fr/wp-content/uploads/2022/11/maison-cubique-scaled.jpg
    [backtrace] => Array
        (
            [0] => Array
                (
                    [file] => /home/piraino/www/wp-includes/class-wp-hook.php
                    [line] => 308
                    [function] => debug_wp_redirect
                    [class] => Permalink_Manager_Debug_Functions
                    [type] => ->
                )

            [1] => Array
                (
                    [file] => /home/piraino/www/wp-includes/plugin.php
                    [line] => 205
                    [function] => apply_filters
                    [class] => WP_Hook
                    [type] => ->
                )

            [2] => Array
                (
                    [file] => /home/piraino/www/wp-includes/pluggable.php
                    [line] => 1377
                    [function] => apply_filters
                )

            [3] => Array
                (
                    [file] => /home/piraino/www/wp-content/plugins/wordpress-seo/src/helpers/redirect-helper.php
                    [line] => 21
                    [function] => wp_redirect
                )

            [4] => Array
                (
                    [file] => /home/piraino/www/wp-content/plugins/wordpress-seo/src/integrations/front-end/redirects.php
                    [line] => 176
                    [function] => do_unsafe_redirect
                    [class] => Yoast\WP\SEO\Helpers\Redirect_Helper
                    [type] => ->
                )

            [5] => Array
                (
                    [file] => /home/piraino/www/wp-includes/class-wp-hook.php
                    [line] => 308
                    [function] => attachment_redirect
                    [class] => Yoast\WP\SEO\Integrations\Front_End\Redirects
                    [type] => ->
                )

            [6] => Array
                (
                    [file] => /home/piraino/www/wp-includes/class-wp-hook.php
                    [line] => 332
                    [function] => apply_filters
                    [class] => WP_Hook
                    [type] => ->
                )

            [7] => Array
                (
                    [file] => /home/piraino/www/wp-includes/plugin.php
                    [line] => 517
                    [function] => do_action
                    [class] => WP_Hook
                    [type] => ->
                )

            [8] => Array
                (
                    [file] => /home/piraino/www/wp-includes/template-loader.php
                    [line] => 13
                    [function] => do_action
                )

            [9] => Array
                (
                    [file] => /home/piraino/www/wp-blog-header.php
                    [line] => 19
                    [args] => Array
                        (
                            [0] => /home/piraino/www/wp-includes/template-loader.php
                        )

                    [function] => require_once
                )

        )

)

I’m living the plugin enabled so you can perhaps see something more on the website.

Guillaume

Hi @cryoth,

Could you try to disable “Media” in “Excluded content types“?

Then, please go to “Tools -> Permalink Duplicates” and click “Fix custom permalinks & redirects“.

You can find more detailed instructions in the below article:
https://permalinkmanager.pro/docs/exclude-content-types/

Best regards,
Maciej

Thread Starter
cryoth

(@cryoth)

Thanks a lot we’ve made the changes and everything’s lokking fine now !

Thank you so much for your celerity 🙂

Perfect, thank you for the update 🙂

 

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