• Resolved hylanddesign

    (@hylanddesign)


    I am using regex redirection on a site that sells online training. The issue is once the event has ended it gets deleted/drafted causing a 404 page. There are various categories which they want that page to be redirected to when a 404 page occurs.

    Settings:
    Match: URL and WordPress page type – page type (404)
    ^\/course-schedule\/professional-scrum-product-owner\/.*
    /our-courses/pspo/

    It’s working when only one rule has been added but I need to add multiple. Only works when one is enabled.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author John Godley

    (@johnny5)

    Just to confirm, you have multiple versions of these rules but only one is working? Can you add another rule here?

    Thread Starter hylanddesign

    (@hylanddesign)

    Yes I currently have two regex redirects for two different categories. I have 8 categories that I wanted this to work with.

    Settings for second rule:
    Match: URL and WordPress page type – page type (404)
    ^\/course-schedule\/professional-scrum-master\/.*
    /our-courses/psm/

    Thread Starter hylanddesign

    (@hylanddesign)

    I have been playing around with redirecting it to the product category instead. So taking the product category from the url and redirecting to /product-category/professional-scrum-master.

    Settings:
    Source: ^\/course-schedule\/(.*)\/(.*)
    Match: URL and WordPress page type – page type (404)
    Target: /product-category/$1

    This is working but its grabbing the whole url bot just the category.
    eg:
    original: /course-schedule/professional-scrum-product-owner/pspo-150721
    redirect: /product-category/professional-scrum-product-owner/pspo-150721

    I don’t want the last part of the url just the category basically.

    Thanks

    Plugin Author John Godley

    (@johnny5)

    I’m a bit confused as to what the current problem is.

    The regular expression will only do what you configure it to do. It is possible you may have multiple regular expressions applying to the same URL.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WooCommerce Regex Redirect 404 pages of categories’ is closed to new replies.