?nonamp=1

#79276
  • Resolved Nenad Nikolic
    Rank Math free

    Hi, first I want to say that your plugin is great.

    I used a plugin for AMP but I don’t use it anymore. While I was using it google indexed some pages with a “?nonamp=1” in the end of url. Because of this now some of the pages have been deindexed.

    I tried to do a redirection using rank math but it didn’t work. I tried all the options: exact, contains, and end with but It seams that rank math doesn’t see that added part of ulr.

    I also tried to solve this problem with .htaccess redirection but my knowledge is not enough to succeed in it.

    Can you tell me if there is an option for rank math to redirect all pages that end with “?nonamp=1” to url’s without that?
    I emphasize that this is not necessary for one link alone, but for several of them,

    https://mysite.com/*/?nonamp=1 to https://mysite.com/*/

    kindly regards,
    Nenad Nikolic
    wwwomansblogs.com

Viewing 10 replies - 1 through 10 (of 10 total)
  • Alberto
    Rank Math business

    Hello,

    Thank you for getting in touch with us.

    By default, Rank Math passes the query strings over to the redirected URL and that is why it seems like it is not working and might even cause redirect loops in certain cases. While we work on a UI option for this, please use the below filter in your theme’s functions.php file to make it work:

    https://rankmath.com/kb/filters-hooks-api-developer/#redirect-remove-query

    After that, you could add the following redirection:

    Source: (.*)/?nonamp=1
    Comparison: Regex
    Destination URL: https://$1

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    I did a redirection as you suggested and tried all 4 options to add in functions.php
    but still the pages are not redirected.

    First just turn off the rank math which of course I don’t want
    1. Filter to disable Rank Math Integration from the Gutenberg Sidebar

    For the next two I saw no change
    2. Filter to add meta keys for enqueueing data in the Gutenberg
    3. Filter to add metadata for enqueueing for Gutenberg use

    And the last provokes critical error
    4. Filter to add extra tabs in the Gutenberg sidebar.

    Maybe I’m not doing this properly, do you want me to give you access to the site or can you explain to me how to fix this if you have time, please

    I received an email informing me that this ticket has received a new response from Michael Davis, but unfortunately, there is no response here

    Hello,

    Sorry about that.

    The code my colleague suggested is the following:

    /**
     * Disable appending the query string in the redirection URL.
     *
     * @param int $number
     */
    add_filter( 'rank_math/redirection/add_query_string', '__return_false' );
    

    Looking forward to helping you. Thank you.

    ​​​​​​

    Unfortunately, this does not work

    Hello,

    We are sorry but you cannot redirect URLs that have a query string in them with Rank Math.

    What that means is that anything with a ? in the URL will not be redirected using Rank Math.

    This is a shortcoming that we plan of removing in an upcoming version of the plugin.

    We would really appreciate your patience in this matter.

    ok tnx, your plugin is great and of course, I will wait 😀

    Alberto
    Rank Math business

    Hello,

    Thank you for your kind words and understanding. Then, do you have any other questions? Or do you want us to close this thread? In any case, we will be here if you have any other questions or issues in the future.

    Looking forward to help you.

    Thank you very much, I can’t wait for new updates

    Hello,

    We are super happy hear that. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

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

The ticket ‘?nonamp=1’ is closed to new replies.