Regex works halfway

  • Resolved David
    free

    I migrated my domain name from Shopify to Woocommerce.

    In Rankmath I created 3 regex with permanent rediction (301):

    1. ^pages/(.*) to remove “pages” from URL (myshop.com/pages/page-name -> myshop.com/page-name).
    Works fine.
    2. ^products/(.*) to remove “products” from URL (myshop.com/products/product-name -> myshop.com/product-name).
    Works fine.

    3. ^collections/(.*) to remove “collections” from URL (myshop.com/collections/product-category-name -> myshop.com/product-category-name).
    Works halfway! About 5 out of 20 URLs work… Why?! That does not make sense!
    Those that don’t work redirect to home page.

    Please help me it’s urgent!

    • This topic was modified 2 weeks, 6 days ago by David.
    • This topic was modified 2 weeks, 6 days ago by David.
Viewing 4 replies - 1 through 4 (of 4 total)
  • When I use debug redirection option, for URL wich do not work, it goes directly home page. For URL which work, the panel is displayed correctly.

    Hello,

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

    Could you please share sample URLs you wish to redirect and also share screenshots of your regex redirection settings with the Source and destination URLs.?

    Looking forward to helping you. Thank you.

    ​​​​​​​

    I finally solved it using another plugin.

    Hello,

    We are glad this is resolved.

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

The ticket ‘Regex works halfway’ is closed to new replies.