Redirection not working

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

    I’m sorry to hear that you are facing issues with redirection. To assist you better, could you please provide more details about the specific redirection you are trying to set up? Additionally, if you have encountered any error messages or if the redirection is not working as expected, please let us know.

    If you have already configured the redirection and it’s not working, you can try the following steps:

    1. Ensure that the redirection rule is correctly set up in Rank Math.
    2. Check for any conflicting redirection rules that might be affecting the desired redirection.
    3. Clear any caches on your website, including browser cache and server-level cache, as cached pages might not reflect the new redirection immediately.

    If the issue persists after trying these steps, please provide more details so we can assist you further. Thank you for reaching out to us!

    Sources:
    Solving Redirection Issues Using Rank Math SEO Plugin » Rank Math
    Page With Redirect – Google Search Console Status » Rank Math
    Why Are Posts Redirecting to www or Non-www Incorrectly?

    Hello,

    Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.

    Please try to use the following filter on your website and see if that works for you:

    function redirect_query_parameter() {
        if (isset($_GET['m']) && $_GET['m'] === '1') {
            $current_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
            $redirect_url = remove_query_arg('m', $current_url);
            wp_redirect($redirect_url, 301);
            exit();
        }
    }
    add_action('template_redirect', 'redirect_query_parameter');
    

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

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

    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 ‘Redirection not working’ is closed to new replies.