• Resolved tslodge1

    (@tslodge1)


    We set redirect on woocommerce products that are out of stock, but this causes problems when they come back in stock. Shopify gets round this issue by ignoring redirects where the target url exists. Can this be replicated with this plugin?
    Thanks

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

    (@johnny5)

    I’m not sure I understand. You have some page (not a product) and want to redirect it only if the target page (the product) doesn’t exist?

    Thread Starter tslodge1

    (@tslodge1)

    Yes
    Product goes out of stock
    We set the product url to draft status.
    We set a redirect from the product url to the brand page url
    When product comes back in stock the product page changes back from draft status to Published so we dont require the redirect.
    But the redirect is still in place and the republished product is never visible.
    So we want the page to redirect only if the target page (the product) doesn’t exist

    • This reply was modified 3 years, 2 months ago by tslodge1.
    Plugin Author John Godley

    (@johnny5)

    Ok, but you originally said you want the redirect to happen if the target doesn’t exist. What you have just described is a redirect where the source doesn’t exist?

    The source of the redirect is the product page. The target is the brand page.

    If that is the case you can probably use the ‘URL and WP page type’ to redirect if it’s a 404.

    https://redirection.me/support/matching-redirects/

    Thread Starter tslodge1

    (@tslodge1)

    Apologies for the confusion ??
    Using the ‘URL and WP page type’ to redirect if it’s a 404 worked exactly as I require. Didn’t know this was possible. I had a few issues with Cloudflare but once I purged the cache all worked fine! Thank you very much for your help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Redirect Only if Out of Stock’ is closed to new replies.