redirect 301 from 404

#801222
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello,

    I understand that you want to set up a mass redirect from URLs ending with a hyphen, followed by a number and a slash to the correct URLs without the numbers at the end. You can achieve this using Rank Math SEO plugin with Regex redirections.

    Here’s how you can set up a Regex redirection in Rank Math:

    1. Go to your WordPress Dashboard.
    2. Navigate to Rank Math SEO > Redirections.
    3. In the Source URL field, enter the following Regex pattern:
      ^/(.*)-[0-9]+/$

      This pattern will match URLs ending with a hyphen, followed by a number and a slash.

    4. In the Destination URL field, enter:
      https://rankmath.com/pricing/

      This will redirect the URLs to the correct format without the numbers at the end.

    5. Click on the “Add Redirection” button to save the changes.

    By setting up this Regex redirection in Rank Math, all URLs ending with a hyphen, followed by a number and a slash will be automatically redirected to the correct URLs without the numbers at the end.

    If you encounter any issues or need further assistance, feel free to reach out to our support team for help.

    Thank you for reaching out with your query!

    Sources:
    How to Redirect Non-WWW Version to WWW Version of Your Website » Rank Math
    Solving Redirection Issues Using Rank Math SEO Plugin » Rank Math
    How to Redirect Posts After Changing URLs » Rank Math
    Why Are Posts Redirecting to www or Non-www Incorrectly?

    Unfortunately the proposed solution does not work

    Hello,

    In this case, you can use this regex redirect to remove the hyphen and numbers from the end ofyour URLs and redirect them to the actual URL slug:

    Source: ^(.+?)-\d+/?$
    Type: Regex
    Destination: /$1

    Here’s a screenshot for your reference:

    regex

    Hope that helps.

    Thank you! it seems to work.

    Now I would like to insert a file that contains the addresses for which to do 301 redirects. Can I even do that?
    A file that has 50 addresses with their new addresses

    Hello,

    Could you please confirm if you want to import the redirections via CSV file? If so, please note that this feature is only available in the PRO version of the plugin.

    For more details, you can check this URL: https://rankmath.com/kb/import-redirects/#csv

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

The ticket ‘redirect 301 from 404’ is closed to new replies.