Problem with 301 redirect after change permalink

#900924
  • Resolved Mina
    Rank Math free

    Hello

    I changed the permalink of my site from /%postname%/ to /%postname%1/ but I have a problem and that is when I click on the previous links . It goes to the home page and does not go to the new destination.
    I would also like to say that automatic post redirections are active in the Rankmath extension of my site, and I want the previous links go to the new destination with a 301 redirect.

    like this:

    Example.com/test to Example.com/test1

    What should I do to solve this problem?

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

    We apologize for the issue you are facing with the 301 redirects after changing your permalink structure. It seems that the automatic post redirection feature in Rank Math is not functioning as expected in this case.

    To resolve this issue, you can manually set up a 301 redirect for the specific URLs that are not redirecting correctly. Here’s how you can do it:

    1. Go to your WordPress Dashboard.
    2. Navigate to Rank Math SEO → Redirections.
    3. Click on the Add New button to create a new redirection rule.
      create new redirection rule
    4. In the Source URL field, enter the old URL (e.g., /test).
    5. In the Destination URL field, enter the new URL (e.g., /test1).
    6. In the Redirection Type section, select 301 Permanent Move.
      select 301 Permanent Move
    7. Click on the Add Redirection button to save the rule.
      click Add Redirection

    By doing this, you should be able to redirect users from the old URL to the new one successfully. If you have multiple URLs to redirect, you can add them in bulk as well.

    If you continue to experience issues or have further questions, please reply to this ticket, and a human agent from the Rank Math Support team will assist you further.

    Thank you for raising this concern! We hope this helps resolve your issue.

    Sources:
    301 vs 302 Redirect: Which One Should You Use? » Rank Math
    How to Fix the Submitted URL Seems to Be a “Soft 404” Error » Rank Math

    Mina
    Rank Math free

    Hello
    Thank you for the rankmath robot, but this answer does not solve my problem.

    Hello,

    Thank you for reaching out to Rank Math support.

    Please note that Rank Math does not automatically redirect your URLs when you change your website’s permalink structure via Settings > Permalink. This functionality is outside the scope of the plugin. You will need to manually create redirects using Rank Math or your .htaccess file. Alternatively, you may consider using a third-party plugin to manage automatic permalink redirection.

    We hope this clarifies the issue. If you have any other questions or concerns, please let us know.

    Mina
    Rank Math free

    Hello
    Thank you for your reply
    Please tell me exactly what code for the .htaccess and also what plugin can I use for redirections?

    Hello,

    Thank you for following up.

    For .htaccess, you can add a custom rule like this for each post:

    
    Redirect 301 /old-url /new-url

    Simply replace /old-url and /new-url with your specific paths.

    If you’re changing the permalink structure site-wide, you can add this code to your .htaccess to redirect from /postname to /postname1:

    RewriteEngine On
    RewriteCond %{REQUEST_URI} !\d$  
    RewriteRule ^(.*)$ /$11 [R=301,L]

    Alternatively, we recommend the Redirection plugin of WP Redirect Permalink for managing multiple redirects easily.

    Let us know if you need further assistance!

    Mina
    Rank Math free

    Hello
    Thanks Jeremy
    I added the code you mentioned to .htaccess, but the problem was not solved.
    I will put the login information to my wpadmin here, I would appreciate it if you could see it.

    Hello,

    We don’t see any redirection added to the server configuration file on your website.

    Please note that this cannot be done with a single rule. You would need to add a rule to each old URL to redirect to the new URL in your .htaccess file.

    That’s why changing the permalink structure for a live website is not recommended because it takes a lot of work to make the new structure work correctly and the redirections can also cause some SEO value to be lost.

    Don’t hesitate to get in touch if you have any other questions.

    Mina
    Rank Math free

    Hello
    Can you added the code to .htaccess and checked worked or not?
    I will put the login information to my wpadmin here, I would appreciate it if you could see it.

    Hello,

    We’ve added the following rule on your .htaccess file and now the /website/ URL is properly getting redirected to /website1/

    RewriteEngine On
    Redirect 301 /website https://p****.ir/website1/
    

    Please check the screenshot in the sensitive data section for reference.

    As we already mentioned above, you’ll have to add the redirections for each of your individual URLs.

    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 9 replies - 1 through 9 (of 9 total)

The ticket ‘Problem with 301 redirect after change permalink’ is closed to new replies.