redirect

#872885
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    We apologize for the issue you are facing with URL redirection. To remove URL parameters and redirect a URL like https://rankmath.com/kb/how-to-setup/ tohttps://rankmath.com/kb/how-to-setup/ you can set up a redirection rule in your .htaccess file. Here’s how you can do it:

    Steps to Redirect URL with Parameters

    1. Edit .htaccess File: You can edit your website’s .htaccess file from the WordPress dashboard by navigating to Rank Math > General Settings > Edit .htaccess.
      Edit .htaccess file in Rank Math

    2. Add Redirection Rule: Add the following code snippet to your .htaccess file after #END WordPress:

      RewriteEngine On
      RewriteCond %{QUERY_STRING} sad
      RewriteRule ^support/$ /support/? [L,R=301]

      This rule checks if the query string contains sad and redirects to the clean URL without parameters.

    3. Save Changes: After adding the code, make sure to save the changes.

    If you have any further questions or need assistance, feel free to reply to this ticket, and a human agent from the Rank Math Support team will assist you further!

    Sources:
    How to Redirect Non-WWW Version to WWW Version of Your Website » Rank Math
    How to Set Up Redirections » Rank Math

    Hello,

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

    In order to redirect URLs with query parameters, please use the following filter code on your website:

    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/

    Hope that helps and please don’t hesitate to let us know if you have any other questions.
     
    Thank 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 ‘redirect’ is closed to new replies.