Create redirection that only works on 404s

  • Is there any way I can create a redirection that only works if the source URL is a 404? Use case for this would be WooCommerce products that get deleted. I would create a Source URL using “starts with”, but I only want the redirect to work on URLs that have a 404 (meaning product has been deleted, or someone is trying a non-existing URL). I know I can redirect each individual product that gets deleted, but using “starts with” would allow me to create a redirect once instead of every time. Does that make sense? Thanks!

    • This topic was modified 3 years, 9 months ago by E-Impact Marketing. Reason: additional clarification
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for contacting Rank Math today.

    I would suggest that you head over to Rank Math > General Settings > Redirections and define a custom fallback redirection option for 404 errors as shown below:

    Looking forward to helping you. Thank you.


    As a basic “fix”, this could work…but it gives no customization for allowing me to redirect deleted products, while not redirecting deleted pages. Deleted products may redirect to the store page, while deleted pages should possibly go to the home page. Thanks for your help!


    Thanks for the follow up.

    I will pass on the feedback to our dev team and hopefully this feature will be added in a future update.

    Feel free to contact us should any other issues come up. Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)

The ticket ‘Create redirection that only works on 404s’ is closed to new replies.