Home › Forums › WoodMart support forum › Theme never returns 404 – all invalid URLs serve the front page (200)

Theme never returns 404 – all invalid URLs serve the front page (200)

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #729616

    wsmile83
    Participant

    Hello,

    On our live WooCommerce store no URL ever returns a 404. Every invalid URL returns HTTP 200 and serves the front page content.

    HOW TO REPRODUCE: request any non-existent URL, e.g. /zzz-does-not-exist/

    OBSERVED BEHAVIOUR:
    – HTTP status is 200, not 404
    – No redirect occurs – the address bar keeps the invalid URL
    – The response is the front page: body class is “home page-template-default page page-id-2188”, and the canonical link points to the site root
    – This happens for every URL shape: plain paths, nested paths, /product/…, /category/…, /product-category/…, and also for query-string requests such as /?p=9999999 and /?page_id=9999999
    – Search (/?s=test) works correctly and renders the search template, so the query system is otherwise healthy

    Because WordPress never reaches the 404 state, the theme’s 404.php template is never loaded, and wp_old_slug_redirect() never fires – so we cannot create redirects for changed permalinks.

    We updated from 8.6.0 to 8.6.1 today and the behaviour is unchanged (re-tested immediately after the update).

    ALREADY RULED OUT ON OUR SIDE:
    – .htaccess – read in full, only standard WP Rocket / WordPress / Wordfence blocks. No ErrorDocument, no redirect directives
    – No mu-plugins directory, no child theme
    – WoodMart’s 404.php – inspected, it is the stock template (header, “Nothing Found”, search form, footer). It contains no redirect and is simply never loaded
    – Theme option “Custom 404 page” is empty; Maintenance mode is off
    – Our two custom plugins and all three WPCode snippets – inspected, none touch is_404, the query, or the front page
    – Not caching – identical behaviour while logged in as admin (WP Rocket bypassed)
    – Not a rewrite rule – query-string requests, which bypass rewrites, behave the same

    The interception clearly happens at query level, before template selection.

    ENVIRONMENT: WoodMart 8.6.1, WordPress 7.1.1, WooCommerce 11.1.0, PHP 8.3.33, MariaDB 11.4.13

    Is this a known behaviour, a theme option we have missed, or a filter we can disable?

    Thank you.

    #729629

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    Hello,

    Thanks for the detailed report. This is not expected WoodMart behavior, and there is no WoodMart setting intended to route all non-existent requests to the front page with a 200 response.

    Since the invalid query-string requests are affected as well, please test this on a staging copy by temporarily disabling all third-party plugins and switching to a default WordPress theme. This will help determine whether the 404 state is being altered by a plugin or custom code outside of the theme.

    If the issue persists with only WoodMart and WoodMart Core active, please provide temporary WordPress admin access via the forum’s Private Content field, along with the staging site URL. Please also confirm the result of the default-theme test.

    Best Regards.

Viewing 2 posts - 1 through 2 (of 2 total)