lasseulrich Posted July 28, 2015 Share Posted July 28, 2015 Hi, I have a couple of years old web shop with only one product in each category. Could anyone please tell me if this "redirect-code" (or what it is) below would hurt my SEO? The code will be in the category.php file in my Prestashop 1.4-shop if ($category->id != 1 && is_object($cookie) &&strpos($_SERVER['HTTP_USER_AGENT'],'bot') === false &&strpos($_SERVER['HTTP_USER_AGENT'],'baidu') === false &&strpos($_SERVER['HTTP_USER_AGENT'],'spider') === false &&strpos($_SERVER['HTTP_USER_AGENT'],'Ask Jeeves') === false &&strpos($_SERVER['HTTP_USER_AGENT'],'slurp') === false &&strpos($_SERVER['HTTP_USER_AGENT'],'crawl') === false){$category = new Category(intval(Tools::getValue('id_category')), intval($cookie->id_lang));$nbProducts = $category->getProducts(NULL, NULL, NULL, $orderBy, $orderWay, true);if ($nbProducts == 1){$cat_products = $category->getProducts(intval($cookie->id_lang), 1, 1, $orderBy, $orderWay);foreach ($cat_products AS $product){Header( "Location: ".$product['link']);exit;}}} Thanks! Link to comment Share on other sites More sharing options...
Zohaib-fk Posted July 28, 2015 Share Posted July 28, 2015 (edited) Hi, As your code is couple of years back,google has updated its search engine software in these years so page redirect is not good practice in SEO world. PrestaShop Tutorials Videos [How to do Tasks] https://www.prestashop.com/forums/topic/907438-prestashop-tutorials-videos-how-to-do-tasks/ Edited June 26, 2021 by Zohaib-fk Post Updated (see edit history) Link to comment Share on other sites More sharing options...
lasseulrich Posted July 28, 2015 Author Share Posted July 28, 2015 Thanks for your reply. Could you please advice what to do instead to get the same effect? Link to comment Share on other sites More sharing options...
Zohaib-fk Posted July 30, 2015 Share Posted July 30, 2015 (edited) Hi, Prestashop 1.5 and 1.6 has lot of new feature in SEO,Security,Design and many more. Is it possible for your company to update your store with latest prestashop version? But upgrading to latest version will take time and efforts. In new version your existing problem will be solved and many new feature will be available. PrestaShop Tutorials Videos [How to do Tasks] https://www.prestashop.com/forums/topic/907438-prestashop-tutorials-videos-how-to-do-tasks/ Edited June 26, 2021 by Zohaib-fk Post Updated (see edit history) Link to comment Share on other sites More sharing options...
lasseulrich Posted July 30, 2015 Author Share Posted July 30, 2015 Hi, Thanks again for your answer, as you are saying an upgrade will take a lot of time, specially since I´ve done a lot of tweaks in different modules and so on... I guess there must be another solution to this, perhaps anyone else can give me a suggestion? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now