301 Redirect Not Working

#125198
  • Resolved Faizan
    free

    Hi, I made a 301 Redirection but it’s not working

    I am trying to redirect This URL (URL 1)

    to This URL (URL 2)

    But Every time I click on the search results my first URL goes to this URL (URL 3)

    Even though I have never redirected the first URL to the Third URL

    I have only made this the redirection for the first URL to the Second URL

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

    Thank you for getting in touch and I am extremely sorry about the trouble this might have caused.

    Your URL is actually being redirected by WordPress, here is a screenshot: REMOVED

    WordPress has a function called wp_old_slug_redirect() used to automatically redirect any post whose slug was recently changed to an existing relative URL, in your case to a URL that is almost similar to the original URL. This only happens if there is an existing post slug that can be phrased to have the same meaning or relate to the post slug changed

    To prevent this behavior for this specific post, delete the _wp_old_slugpost meta entry from the database for that post.

    To prevent this behavior for all posts, prevent the function from being used at all:

    
    remove_action( 'template_redirect', 'wp_old_slug_redirect' );
    

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

    We cleared all the old slugs. Cleared all caches but the issue still exists. And also Can I move my links to the sensitive data section. I don’t want them to be visible to the public.

    Hello,

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

    Hello, I moved your URL’s to the Sensitive Data section.

    Back to the issue, 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.
    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.

    Sorry but I can’t do that can you guide me through it some how. I know that you have no I’ll will but I won’t get permission for this due to security concerns.

    Hello,

    Thank you for keeping in touch with us.

    May I ask if you have added this code to your function.php file?

    remove_action( 'template_redirect', 'wp_old_slug_redirect' );

    If you did and the issue persists, this might be an .htaccess related issue, can you please check it with your web hosting provider and tell them about this issue?

    Let me know how it goes. Thank you.

    I do not know why the issue occur in the first place but now it is clear

    Hello,

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

The ticket ‘301 Redirect Not Working’ is closed to new replies.