Fix url issue nested subcategory
-
Hi,
My URL structure for category product pages is:
https://www.example.com/product-category/parent-category/subcategory. This is working fine but now the problem is that it is still loading the subcategory content if I use following URL
https://www.example.com/product-category/parent-category/any-string/subcategory
Is there a way I can stop it and start displaying 404 errors?`
Thanks.
-
Could you please share a copy of your site’s System Status? You can find it via WooCommerce > Status. Select “Get system report” and then “Copy for support”.? Once you’ve done that, paste it here in your response.
### WordPress Environment ### WordPress address (URL): https://xxx.com Site address (URL): https://xxx.com WC Version: 5.8.0 REST API Version: ? 5.8.0 WC Blocks Version: ? 5.9.1 Action Scheduler Version: ? 3.3.0 WC Admin Version: ? 2.7.2 Log Directory Writable: ? WP Version: 5.8.2 WP Multisite: – WP Memory Limit: 1 GB WP Debug Mode: – WP Cron: ? Language: es_ES External object cache: – ### Server Environment ### Server Info: Apache PHP Version: 7.4.25 PHP Post Max Size: 128 MB PHP Time Limit: 30 PHP Max Input Vars: 1000 cURL Version: 7.64.0 OpenSSL/1.1.1d SUHOSIN Installed: – MySQL Version: 5.7.33-log Max Upload Size: 128 MB Default Timezone is UTC: ? fsockopen/cURL: ? SoapClient: ? DOMDocument: ? GZip: ? Multibyte String: ? Remote Post: ? Remote Get: ? ### Database ### WC Database Version: 5.8.0 WC Database Prefix: oppDr Tama?o total de la base de datos: 228.81MB Tama?o de los datos de la base de datos: 141.25MB Tama?o del índice de la base de datos: 87.56MB oppDrwoocommerce_sessions: Datos: 0.02MB + índice: 0.02MB + Motor InnoDB oppDrwoocommerce_api_keys: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrwoocommerce_attribute_taxonomies: Datos: 0.02MB + índice: 0.02MB + Motor InnoDB oppDrwoocommerce_downloadable_product_permissions: Datos: 0.02MB + índice: 0.06MB + Motor InnoDB oppDrwoocommerce_order_items: Datos: 0.02MB + índice: 0.02MB + Motor InnoDB oppDrwoocommerce_order_itemmeta: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrwoocommerce_tax_rates: Datos: 0.02MB + índice: 0.06MB + Motor InnoDB oppDrwoocommerce_tax_rate_locations: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrwoocommerce_shipping_zones: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrwoocommerce_shipping_zone_locations: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrwoocommerce_shipping_zone_methods: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrwoocommerce_payment_tokens: Datos: 0.02MB + índice: 0.02MB + Motor InnoDB oppDrwoocommerce_payment_tokenmeta: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrwoocommerce_log: Datos: 0.02MB + índice: 0.02MB + Motor InnoDB oppDractionscheduler_actions: Datos: 0.17MB + índice: 0.22MB + Motor InnoDB oppDractionscheduler_claims: Datos: 0.02MB + índice: 0.02MB + Motor InnoDB oppDractionscheduler_groups: Datos: 0.02MB + índice: 0.02MB + Motor InnoDB oppDractionscheduler_logs: Datos: 1.52MB + índice: 0.13MB + Motor InnoDB oppDrac_segments: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDradmin_columns: Datos: 0.02MB + índice: 0.02MB + Motor InnoDB oppDrajaxsearchpro: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrajaxsearchpro_priorities: Datos: 0.02MB + índice: 0.02MB + Motor InnoDB oppDrajaxsearchpro_statistics: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrasp_index: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrasp_synonyms: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrberocket_termmeta: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrcmplz_cookiebanners: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrcmplz_cookies: Datos: 0.05MB + índice: 0.00MB + Motor InnoDB oppDrcmplz_services: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrcommentmeta: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrcomments: Datos: 0.02MB + índice: 0.09MB + Motor InnoDB oppDrdgwt_wcas_index: Datos: 0.27MB + índice: 0.02MB + Motor InnoDB oppDrdgwt_wcas_invindex_cache_de: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrdgwt_wcas_invindex_cache_en: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrdgwt_wcas_invindex_cache_es: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrdgwt_wcas_invindex_cache_fr: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrdgwt_wcas_invindex_doclist_de: Datos: 0.19MB + índice: 0.17MB + Motor InnoDB oppDrdgwt_wcas_invindex_doclist_en: Datos: 0.19MB + índice: 0.17MB + Motor InnoDB oppDrdgwt_wcas_invindex_doclist_es: Datos: 0.20MB + índice: 0.19MB + Motor InnoDB oppDrdgwt_wcas_invindex_doclist_fr: Datos: 0.20MB + índice: 0.19MB + Motor InnoDB oppDrdgwt_wcas_invindex_info: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrdgwt_wcas_invindex_wordlist_de: Datos: 0.03MB + índice: 0.02MB + Motor InnoDB oppDrdgwt_wcas_invindex_wordlist_en: Datos: 0.03MB + índice: 0.02MB + Motor InnoDB oppDrdgwt_wcas_invindex_wordlist_es: Datos: 0.03MB + índice: 0.02MB + Motor InnoDB oppDrdgwt_wcas_invindex_wordlist_fr: Datos: 0.03MB + índice: 0.02MB + Motor InnoDB oppDrgf_draft_submissions: Datos: 0.02MB + índice: 0.02MB + Motor InnoDB oppDrgf_entry: Datos: 0.16MB + índice: 0.03MB + Motor InnoDB oppDrgf_entry_meta: Datos: 0.23MB + índice: 0.34MB + Motor InnoDB oppDrgf_entry_notes: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrgf_form: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrgf_form_meta: Datos: 0.06MB + índice: 0.00MB + Motor InnoDB oppDrgf_form_revisions: Datos: 0.05MB + índice: 0.03MB + Motor InnoDB oppDrgf_form_view: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrgf_rest_api_keys: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrimagify_files: Datos: 0.02MB + índice: 0.08MB + Motor InnoDB oppDrimagify_folders: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrlctr2_conf: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrlctr2_locations: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrlctr2_migrations: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrlctr2_relations: Datos: 0.02MB + índice: 0.05MB + Motor InnoDB oppDrlctr2_searchlog: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrlinks: Datos: 0.02MB + índice: 0.02MB + Motor InnoDB oppDrnewsletter: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrnewsletter_emails: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrnewsletter_sent: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrnewsletter_stats: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrnewsletter_user_logs: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDroptions: Datos: 3.50MB + índice: 0.25MB + Motor InnoDB oppDrpmxe_exports: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrpmxe_google_cats: Datos: 0.39MB + índice: 0.00MB + Motor InnoDB oppDrpmxe_posts: Datos: 0.50MB + índice: 0.00MB + Motor InnoDB oppDrpmxe_templates: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrpmxi_files: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrpmxi_hash: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrpmxi_history: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrpmxi_images: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrpmxi_imports: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrpmxi_posts: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrpmxi_templates: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrpostmeta: Datos: 57.59MB + índice: 49.16MB + Motor InnoDB oppDrposts: Datos: 31.52MB + índice: 7.06MB + Motor InnoDB oppDrpremmerce_search_words: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrpum_subscribers: Datos: 0.02MB + índice: 0.06MB + Motor InnoDB oppDrredirection_404: Datos: 0.02MB + índice: 0.05MB + Motor InnoDB oppDrredirection_groups: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrredirection_items: Datos: 0.13MB + índice: 0.16MB + Motor InnoDB oppDrredirection_logs: Datos: 0.02MB + índice: 0.05MB + Motor InnoDB oppDrsgpb_subscribers: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrsgpb_subscription_error_log: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrsmush_dir_images: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrtermmeta: Datos: 0.05MB + índice: 0.03MB + Motor InnoDB oppDrterms: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrterm_relationships: Datos: 0.14MB + índice: 0.11MB + Motor InnoDB oppDrterm_taxonomy: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrtrp_dictionary_es_es_de_de: Datos: 3.52MB + índice: 2.98MB + Motor InnoDB oppDrtrp_dictionary_es_es_en_gb: Datos: 0.08MB + índice: 0.08MB + Motor InnoDB oppDrtrp_dictionary_es_es_en_us: Datos: 3.52MB + índice: 3.19MB + Motor InnoDB oppDrtrp_dictionary_es_es_fr_fr: Datos: 3.52MB + índice: 3.11MB + Motor InnoDB oppDrtrp_gettext_de_de: Datos: 1.52MB + índice: 0.58MB + Motor InnoDB oppDrtrp_gettext_en_gb: Datos: 0.02MB + índice: 0.05MB + Motor InnoDB oppDrtrp_gettext_en_us: Datos: 0.45MB + índice: 0.55MB + Motor InnoDB oppDrtrp_gettext_es_es: Datos: 1.52MB + índice: 0.59MB + Motor InnoDB oppDrtrp_gettext_fr_fr: Datos: 1.52MB + índice: 0.53MB + Motor InnoDB oppDrtrp_original_meta: Datos: 0.17MB + índice: 0.27MB + Motor InnoDB oppDrtrp_original_strings: Datos: 5.52MB + índice: 3.52MB + Motor InnoDB oppDrusermeta: Datos: 0.11MB + índice: 0.03MB + Motor InnoDB oppDrusers: Datos: 0.02MB + índice: 0.05MB + Motor InnoDB oppDrwc_admin_notes: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrwc_admin_note_actions: Datos: 0.02MB + índice: 0.02MB + Motor InnoDB oppDrwc_category_lookup: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrwc_customer_lookup: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrwc_download_log: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrwc_order_coupon_lookup: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrwc_order_product_lookup: Datos: 0.02MB + índice: 0.06MB + Motor InnoDB oppDrwc_order_stats: Datos: 0.02MB + índice: 0.05MB + Motor InnoDB oppDrwc_order_tax_lookup: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDrwc_product_meta_lookup: Datos: 0.09MB + índice: 0.13MB + Motor InnoDB oppDrwc_reserved_stock: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrwc_tax_rate_classes: Datos: 0.02MB + índice: 0.02MB + Motor InnoDB oppDrwc_webhooks: Datos: 0.02MB + índice: 0.02MB + Motor InnoDB oppDrwfblockediplog: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrwfblocks7: Datos: 0.02MB + índice: 0.05MB + Motor InnoDB oppDrwfconfig: Datos: 2.44MB + índice: 0.00MB + Motor InnoDB oppDrwfcrawlers: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrwffilechanges: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrwffilemods: Datos: 5.52MB + índice: 0.00MB + Motor InnoDB oppDrwfhits: Datos: 0.02MB + índice: 0.05MB + Motor InnoDB oppDrwfhoover: Datos: 0.02MB + índice: 0.02MB + Motor InnoDB oppDrwfissues: Datos: 0.05MB + índice: 0.06MB + Motor InnoDB oppDrwfknownfilelist: Datos: 2.52MB + índice: 0.00MB + Motor InnoDB oppDrwflivetraffichuman: Datos: 0.02MB + índice: 0.02MB + Motor InnoDB oppDrwflocs: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrwflogins: Datos: 0.08MB + índice: 0.03MB + Motor InnoDB oppDrwfls_2fa_secrets: Datos: 0.02MB + índice: 0.02MB + Motor InnoDB oppDrwfls_settings: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrwfnotifications: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrwfpendingissues: Datos: 0.22MB + índice: 0.06MB + Motor InnoDB oppDrwfreversecache: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrwfsnipcache: Datos: 0.02MB + índice: 0.05MB + Motor InnoDB oppDrwfstatus: Datos: 0.13MB + índice: 0.09MB + Motor InnoDB oppDrwftrafficrates: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDrwpfm_backup: Datos: 0.02MB + índice: 0.00MB + Motor InnoDB oppDryoast_indexable: Datos: 6.50MB + índice: 5.56MB + Motor InnoDB oppDryoast_indexable_hierarchy: Datos: 1.48MB + índice: 0.77MB + Motor InnoDB oppDryoast_migrations: Datos: 0.02MB + índice: 0.02MB + Motor InnoDB oppDryoast_primary_term: Datos: 0.02MB + índice: 0.03MB + Motor InnoDB oppDryoast_seo_links: Datos: 1.52MB + índice: 5.03MB + Motor InnoDB ### Post Type Counts ### acf-field: 3 acf-field-group: 3 advquiz: 1 attachment: 4460 br_labels: 1 counter_numbers: 1 cpt_variation_fields: 1 ct_content_block: 1 custom_css: 2 customize_changeset: 10 dtsl_listings: 323 language_switcher: 5 maps: 1 moss-keyword: 1 nav_menu_item: 30 page: 19 popup: 1 popup_theme: 8 popupbuilder: 1 post: 11 product: 104 product_variation: 480 ps-questions: 1 rc_blocks: 30 revision: 9502 sp_wps_shortcodes: 1 store_locator: 10 stores: 8182 vc_grid_item: 1 wcpcsu-custom-post: 1 wcps: 1 wcps_layout: 1 wcsf: 1 wcsf_inquiry: 4332 wcsf_question: 5 yith_wcps_type: 1 ### Security ### Secure connection (HTTPS): ? Hide errors from visitors: ? ### Active Plugins (41) ### Gravity Forms: por Gravity Forms – 2.5.15 weLaunch Framework: por weLaunch.io – 1.0.9 Admin Columns Pro: por AdminColumns.com – 5.6 Advanced WordPress Backgrounds: por nK – 1.7.6 Advanced Custom Fields: por Delicious Brains – 5.11.3 WooCommerce Advanced Product Labels: por BeRocket – 1.2.3.2 FiboSearch - AJAX Search for WooCommerce (Pro): por Equipo de FiboSearch – 1.13.0 All-in-One WP Migration Unlimited Extension: por ServMask – 2.42 All-in-One WP Migration: por ServMask – 7.49 Bulk Meta Editor: por Aries Dajay – 1.0.1 Editor clásico: por Colaboradores de WordPress – 1.6.2 Complianz | GDPR/CCPA Cookie Consent: por Plugins Really Simple – 5.5.1 WP Frontend Admin (Premium): por WP Frontend Admin – 1.15.0.4 Font Awesome: por Font Awesome – 4.0.4 Imagify: por WP Media – 1.10 WPBakery Page Builder: por Michael M - WPBakery.com – 6.7.0 Neve Pro Addon: por ThemeIsle – 5.5.5 Newsletter: por Stefano Lissa el equipo de Newsletter – 7.2.9 Popup Builder: por Sygnoos – 4.0.4 Product Filter for WooCommerce: por XforWooCommerce – 8.1.1 Premmerce Product Search for WooCommerce: por premmerce – 2.2 PW WooCommerce Bulk Edit Pro: por Pimwick LLC – 2.292 Reusable Content Blocks: por Thecodepoetry – 1.1.1 SVG Segura: por Daryll Doyle – 1.9.9 Shortcodes Ultimate: por Vladimir Anokhin – 5.11.1 TranslatePress - Business: por Cozmoslabs Razvan Mocanu Madalin Ungureanu – 1.0.6 TranslatePress - Multilingual: por Cozmoslabs Razvan Mocanu Madalin Ungureanu Cristophor Hurduban – 2.1.4 User Role Editor: por Vladimir Garagulya – 4.60.2 Premmerce Permalink Manager for WooCommerce: por premmerce – 2.3.3 Variation Swatches for WooCommerce - Pro: por Emran Ahmed – 1.1.18 Variation Swatches for WooCommerce: por Emran Ahmed – 1.1.19 WooCommerce Additional Variation Images: por WooCommerce – 1.9.0 WooCommerce Step Filter: por [email protected] – 7.8.0 WooCommerce: por Automattic – 5.8.0 (la actualización a la versión 5.9.0 está disponible) Wordfence Security: por Wordfence – 7.5.7 Yoast SEO: por Equipo Yoast – 17.7.1 Localizador de tiendas de WordPress: por weLaunch – 2.1.0 WP All Export Pro: por Soflyy – 1.7.1 WP Meteor: por Aleksandr Guidrevitch – 2.3.10 WPS Hide Login: por WPServeur NicolasKulka wpformation – 1.9.1 ### Inactive Plugins (3) ### Popup Builder Scroll: por Sygnoos – 1.6 Redirection: por John Godley – 5.1.3 Woo Shortcodes Kit: por Alberto G. – 1.9.9 ### Must Use Plugins (1) ### 1&1 Product Subdomain: por 1&1 – 1.1.0 ### Settings ### API Enabled: – Force SSL: – Currency: USD ($) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: – ### WC Pages ### Base de la tienda: #10 - /xxx Carrito: #17621 - /carrito Finalizar compra: #17622 - /finalizar-compra Mi cuenta: #17623 - /mi-cuenta Términos y condiciones: ? Página sin definir ### Theme ### Name: Neve Child Version: 1.0.0 Author URL: https://themeisle.com Child Theme: ? Parent Theme Name: Neve Parent Theme Version: 5.11.6 Parent Theme Author URL: https://themeisle.com WooCommerce Support: ? ### Templates ### Overrides: La version - de neve/woocommerce/product-searchform.php está obsoleta. La versión del núcleo es la 3.3.0 Outdated Templates: ? Aprende cómo actualizar ### Action Scheduler ### Completo: 31 Oldest: 2021-11-02 10:57:02 +0000 Newest: 2021-12-03 06:06:27 +0000 Fallida: 418 Oldest: 2021-08-23 10:39:57 +0000 Newest: 2021-10-18 11:40:04 +0000 Pendiente: 1 Oldest: 2021-12-03 10:30:31 +0000 Newest: 2021-12-03 10:30:31 +0000 ### Status report information ### Generated at: 2021-12-03 10:29:33 +00:00
WooCommerce automatically redirects search results to single product pages. You can disable it using the filter in this guide.
The problem persists. The solution you propose is to remove the redirect when searching for a product. But my problem is that when searching in a subcategory that does not exist it redirects to a category that does exist.
I have created a test installation with product categories and subcategories:
For instance:
https://disturbed-hippopotamus.w5.wpsandbox.pro/product-category/circle/black-circle/
It works.
If I add any word between the categories …
https://disturbed-hippopotamus.w5.wpsandbox.pro/product-category/circle/anystring/black-circle/
…It does not show 404 error.
-
This reply was modified 3 years, 3 months ago by
masini2002.
Hi again,
I think I understand what you mean. WooCommerce automatically ignores any faulty string. https://woo-supportwork.laravel/product-category/minidisc/.pp/ultrasmall/ = https://woo-supportwork.laravel/product-category/minidisc/ultrasmall/
Screenshot: https://d.pr/i/fumBLl
I tried some redirection plugin for this. I also tried the filter. Both to no avail. I am afraid this will need custom coding, so I am gonna leave the thread open to see if anybody can chime in.
Kind regards,
We’ve not seen any activity on this thread for a while, so I’m marking this thread as resolved. If you have further questions, please feel free to open a new topic.
-
This reply was modified 3 years, 3 months ago by
- The topic ‘Fix url issue nested subcategory’ is closed to new replies.