Prestashop: Keyword "{id_product_attribute}" required for route "product_rule"

Created on 7 Jan 2019  Â·  6Comments  Â·  Source: PrestaShop/PrestaShop

After otherwise successful migration from PS 1.6 to 1.7.5 when turning on "URL rewriting" (in "Shop Parameters - Traffic & SEO") I get the following error message:

Keyword "{id_product_attribute}" required for route "product_rule" (rule: "{category:/}{id}-{rewrite}{-:ean13}")

I can't switch on url rewrite because of that and I can't edit the URL scheme either, it is just not there.
I am using default prestashop modules and classic template.

Rewrite settings in old version (1.6) were as follows:

Route to products: {category:/}{id}-{rewrite}{-:ean13}
Route to category: {id}-{rewrite}
Route to category which has the "selected_filter" attribute for the "Layered Navigation" (blocklayered) module: {id}-{rewrite}{/:selected_filters}
Route to supplier: {id}__{rewrite}
Route to manufacturer: {id}_{rewrite}
Route to CMS page: content/{id}-{rewrite}
Route to CMS category: content/category/{id}-{rewrite}
Route to modules: module/{module}{/:controller}

Would it help if I change the "Route to products" to
{category:/}{id}{-:id_product_attribute}-{rewrite}{-:ean13}
before upgrading from 1.6 to 1.7?

How to change that after the upgrade?

Additional information
PrestaShop version: 1.7.5.0
PHP version: 7.2.13
2019-01-07_prestashop01

1.7.5.0 BO No change required SEO & URLs

Most helpful comment

@Goalfair, in your case "Friendly in disabled.
Could you please enable Friendly URLs Manually => you can do it in the database under the PREFIX_configuration table => search for the entry with name field equal to PREFIX_REWRITING_SETTINGS & edit the value to 1.
Or you can run this request SQL: UPDATEPREFIX_configurationSETvalue= '1' WHEREPREFIX_configuration.id_configuration= 9;

PS: PREFIX is the prefix of your tables, it could be for example ps.

Then you need to add {-:id_product_attribute} to the product route.
Thanks to check & feedback.

All 6 comments

Hi @Goalfair,

In the SEO&URLs page, in the Schema of URLs part, you can find the route to products:
The {-:id_product_attribute} is required, you need to add it.
image
Thanks to check & feedback.

Related to #12026

This whole section is missing in 1.7 (it was there in 1.6).

The following sections are present in menu item "traffic & seo":
• SEO & URLs
• Set up URLs
• Set shop URL
• Robots file generation

I do not have a "Schema of URLs", presumably because I can not turn on the "URL rewrite"?

@Goalfair, in your case "Friendly in disabled.
Could you please enable Friendly URLs Manually => you can do it in the database under the PREFIX_configuration table => search for the entry with name field equal to PREFIX_REWRITING_SETTINGS & edit the value to 1.
Or you can run this request SQL: UPDATEPREFIX_configurationSETvalue= '1' WHEREPREFIX_configuration.id_configuration= 9;

PS: PREFIX is the prefix of your tables, it could be for example ps.

Then you need to add {-:id_product_attribute} to the product route.
Thanks to check & feedback.

The command did not work, however I looked up the entry manually and changed it from 0 to 1.

Now the "Schema of URLs" section is available in "Traffic & SEO", and after changing the "Route to products" to
{category:/}{id}{-:id_product_attribute}-{rewrite}
I finally can enable URL rewrite. Thanks!

The last thing I had to do (just if someone else experiences a similar problem) was to use the same URL for "Shop domain" and "SSL domain". Previously the "Shop domain" had a www in front of it and the "SSL domain" did not, which meant when enabling "url rewrite" all the images would not be displayed (because of wrong URL).

@Goalfair, thanks for your feedback.
Feel free to open a new one when needed.
Thanks!

Was this page helpful?
0 / 5 - 0 ratings