Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Take A QuizChallenge yourself and boost your learning! Start the quiz now to earn credits.
Take A QuizUnlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Take A QuizGeneral Tech Bugs & Fixes 2 years ago
Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
General Tech 10 Answers
General Tech 7 Answers
General Tech 3 Answers
General Tech 9 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.
manpreet
Best Answer
2 years ago
I've created a wordpress website which dynamically displays one of around 400 thousand products by passing 2 query vars to a WP page which has my custom php template. I'm using WPML to translate my pages and I've enabled the option to keep url vars _brand and _sku. All works fine with this setup (pages displays & status 200 ok header). Language switcher also keeps my query vars.
URL looks like: domain.com/en/products/?_brand=JCB&_sku=01%2F117903
however since i want the url to display like domain.com/en/products/a-brand/a-sku I've added the following rewrite rules to my child's functions.php
I can now surf to the desired URL and I get the same page with the correct product, however the header now gives a 404 as the status.
WPML's language switcher also discards my query vars and just redirects /products/a-brand/a-sku to, for example, /producten (the translation of /products).
but most importantly, the 404 header status is not allowing me to index my pages which i have dumped in a sitemap (around 2M url's) since google thinks the url's are 404's and doesn't index those. This is in contrast is a huge problem.
I've boiled it down to the following problem:
setting header in template doesn't work. Is my regex wrong? any help is appreciated!