Split: Cannot change canonical url on dynamic urls

#816371
Viewing 2 replies - 1 through 2 (of 2 total)
  • Here’s the url taxonomy of the template: website.com/view-detail-page/ , and here’s a sample of the unique page taxonomy: website.com/view-detail-page/CC717382/Custom-Classic-Trailer-7-X-24-Aluminum-Gooseneck-Livestock-Trailer/

    Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    We have separated your concern to a new ticket so we can assist you further.

    Could you please share the filter you have created so we can also check?

    Meanwhile, you may try this one and check if the canonical URL again:

    add_filter( 'rank_math/frontend/canonical', function( $canonical ) {
        // Check if the current URL contains the 'view-detail-page' parameter
        if ( isset( $_GET['view-detail-page'] ) ) {
            // Create a new canonical URL based on the current URL
            $canonical = home_url( $_SERVER['REQUEST_URI'] );
        }
    
        return $canonical;
    });

    Looking forward to helping you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

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

The ticket ‘Split: Cannot change canonical url on dynamic urls’ is closed to new replies.