Redirects

#939284
  • Resolved Adam
    Rank Math free

    Hello,

    I am having some problems redirecting some URLs like this one: product/search?search=bubble+gum

    I have tried the following but it is still not working:

    Bot Avatar
    To redirect URLs like product/search?search=bubble+gum, you can use Rank Math’s redirection feature. Here’s how you can set it up:

    Go to Rank Math in your WordPress Dashboard: Navigate to Rank Math > Redirections.
    Add a New Redirection: Click on the Add New button.
    Set Up the Redirect:
    In the Source URL field, enter the URL you want to redirect from. For query strings, you can use a regex pattern like this:
    ^product/search?search=bubble+gum
    Copy
    In the Destination URL field, enter the URL where you want to redirect users.
    Choose the Redirect Type: Select the type of redirect (301, 302, etc.) based on your needs.
    Save Changes: Click on the Save Changes button to apply the redirect.
    If you are still having issues, ensure that there are no conflicting redirects or rules in your .htaccess file or any other redirection settings that might be causing problems. You can check your .htaccess file through Rank Math by navigating to Rank Math > General Settings > Edit .htaccess.

    For more detailed guidance, you can refer to the Rank Math documentation on redirection.

    Sources

    Kind Regards,

    Adam

Viewing 15 replies - 1 through 15 (of 15 total)
  • Hello,

    Thank you for contacting us and bringing your concern to our attention.

    Please try to use the following filter code on your website to redirect the URLs properly with the query parameter:

    add_filter( 'rank_math/redirection/add_query_string', '__return_false' );
    

    Here’s how you can add filter/hook to your WordPress site: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Once done, you can add the redirection like the following one:

    Source URL: search?search=bubble+gum
    

    Let us know how it goes. Looking forward to helping you.

    Adam
    Rank Math free

    Thank you for this, I am trying to add the code to rank-math.php but there is nowhere to copy the code I need to use?

    Adam
    Rank Math free

    I have added the following code to rank-math.php:

    add_filter( ‘rank_math/redirection/add_query_string’, ‘__return_false’ );

    Now what should i add to the functions.php?

    Adam
    Rank Math free

    Trying to follow this guide but its not possible as it dosnt give you the code that needs to be used:

    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Hello,

    You can add the exact following code on your website:

    add_filter( 'rank_math/redirection/add_query_string', '__return_false' );
    

    You can add this to your theme’s functions.php file or can use a plugin like Code Snippet to add this filter on your website.

    Let us know how it goes. Looking forward to helping you.

    Thank you.

    Adam
    Rank Math free

    I have added this code but it does not work?

    Adam
    Rank Math free

    Also why does it say Rank Math Free when I am using the pro version?

    Hello,

    In this account, your Rank Math PRO has ended in August of this year. To continue using the PRO feature, you can purchase a new plan from here: https://rankmath.com/pricing/

    If the issue persists on your website, we might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.

    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Adam
    Rank Math free

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    We already shared this with our developers and they are investigating it. As soon as we get some updates, we’ll make sure to let you know here.

    We would really appreciate your kind patience regarding this issue.

    Please don’t hesitate to let us know if you have any other questions.

    Thank you.

    Hello,

    We have added a snippet named Redirect Regex with Query Fix with a filter to fix the issue. This issue has also been logged, and a permanent fix will be included in an upcoming release.

    We apologize for any inconveniences that might have been caused by this issue.

    Thank you.

    Adam
    Rank Math free

    Great news, thank you for all the help it is much appriciated! 🙂

    Hello,

    We are glad that helped.

    Can you please confirm if you still need our assistance with anything else or we can close the ticket?

    Looking forward to hearing back from you.

    Thank you.

    No that’s all thank you 😊

    Hello,

    We are super happy that this resolved your issue. 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 15 replies - 1 through 15 (of 15 total)

The ticket ‘Redirects’ is closed to new replies.