Jump to content

URL with category


gigant09

Recommended Posts

Hi,

 

I'm running Prestashop 1.5.3.1.

My product URL look like that: www.shop.com/category-name/id-product.html

Route to products: /category/{id}-{rewrite}.html

 

I've imported all table manually to a new 1.5.6.1 installation.

Now my URLs looking like:  www.shop.com/id-product.html

Route to products: {id}-{rewrite}.html

 

I can't change route to products to: /category/{id}-{rewrite}.html

If I do that, prestashop doesn't put the category-name there.

 

My question now, google have indexed the old links, what could i do to avoid url problems??

 

Link to comment
Share on other sites

same like the old store: www.shop.com/category-name/id-product.html

 

OR

 

If possible the new format: www.shop.com/id-product.html

but then i need to know how to redirect the old urls to the new format because actually I'm getting a 404 if I use the old url format on the new shop...

Link to comment
Share on other sites

I've found the solution.

 

in classes/link.php
 
changed:
if ($dispatcher->hasKeyword('product_rule', $id_lang, 'category', $id_shop))
$params['category'] = (!is_null($product->category) && !empty($product->category)) ? Tools::str2url($product->category) : Tools::str2url($category);

TO:

if ($dispatcher->hasKeyword('product_rule', $id_lang, 'category'))
$params['category'] = Tools::str2url($product->category);

AND:

Preferences separator_breadcrumb.png SEO & URLs Route to products:               {category}/{id}-{rewrite}.html

 

 

for seo is it better to include the category names in the url?

if I want to use the url without category name, what do i have to do to redirect the old urls?

 

Thank you!

Edited by enjoy-vietnam (see edit history)
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...