• Resolved LAPSrj

    (@lapsrj)


    When I activate The SEO Framework, search queries with “&post_type=product” in the URL are 301 redirected to the homepage. If I remove the post type from the url, to use the regular WordPress search, it works. If I disable TSF, WooCommerce search works again.

    I’m using WooCommerce 3.4.4 and TSF 3.0.6.

    Do you have any idea of what may be causing this problem?

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter LAPSrj

    (@lapsrj)

    I just solved it. I remembered that I had configured it to redirect the “store” page to the homepage, the products, cart, checkout were working fine so I thought it was ok. But today I noticed that search bug. I removed the redirect and the search worked again. I will use another way to redirect the store page to the homepage.

    Plugin Author Sybre Waaijer

    (@cybr)

    Thanks for reporting this issue!

    I’m afraid there’s no way around it in TSF because when we put in an exclusion (like search), users are able to bypass the redirect. I consider that a security issue.

    I suggest using a .htaccess redirect, instead.

    Redirect 301 ^shop-page/$ https://example.com/
    Redirect 301 ^shop-page$ https://example.com/
    

    This snippet should redirect pages starting with shop-page/ or shop-page, and not its sub-pages (thanks to $, saying it’s the end of the URL), to https://example.com/.

    I listed two rules because WordPress might force a trailing slash depending on your permalink settings.

    I hope this helps 🙂 Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WooCommerce search not working when TSF is active’ is closed to new replies.