Jump to content

Will this code hurt my SEO?


lasseulrich

Recommended Posts

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

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 by Zohaib-fk
Post Updated (see edit history)
Link to comment
Share on other sites

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 by Zohaib-fk
Post Updated (see edit history)
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...