Prestashop 1.7.5.2 php 7.2.19 on debian
If I try to delete .html at the end of products ulr, refresh, delete cache, rebuild htaccess, refresh and delete again and again, the same product page without .html goes on 404
Maybe this fix this issue https://github.com/PrestaShop/PrestaShop/issues/11773#issuecomment-501638832
(edit--> no, not solve for me)
Hi @centoasa,
Once you have updated your fields, do not forget to save your changes, then on the "Save" button in the "Set up URLs" section in order to regenerate your .htaccess file, which is necessary for your friendly URLs.
To regenerate the file .htaccess you need to follow these steps:
Rename the old file to .htaccess_old
Disable friendly URL
Enable friendly URL
https://drive.google.com/file/d/12f8vjCi0MwCDdup5IPOCp9UjLlevhR5l/view
Thanks to check & feedback.
with my configuration {id}{-:id_product_attribute}-{rewrite} always 404
it works only with {category:/}{id}{-:id_product_attribute}-{rewrite}
but if I would to delete the {category:/} too, it doesn't works!
@centoasa, it doesn't work, this is normal behavior because this schema is incorrect in this case, you shouldn't change it.
Thanks!
so I can't use {id}{-:id_product_attribute}-{rewrite} schema?
what do you suggest?
@centoasa, you need to use this {category:/}{id}{-:id_product_attribute}-{rewrite}
Thanks!
This is off topic, but for info, we must avoid if we can use Php 7.2.19 which would be apparently bugged!
@Peterits, you have issues with PHP7.2, in your shop?
Thanks!
@Peterits off topics? we talking about Prestashop and own seo performance.
@centoasa, can I close the issue?
Thanks!
@khouloudbelguith yes, I'm closing.
@centoasa, thanks for your feedback.
Feel free to open a new one when needed.
Thanks!
Sorry: now I'm using the url schema {id}{-:id_product_attribute}-{rewrite}.html
So, how can I redirect old default url {category:/}{id}{-:id_product_attribute}-{rewrite}.html to my new {id}{-:id_product_attribute}-{rewrite}.html via htaccess?
@centoasa, you can find some modules to get a pretty URL on our MarketPlace Addons, for example, https://addons.prestashop.com/en/url-redirects/16633-pretty-urls-remove-ids-numbers-for-seo-friendly-url.html
Thanks!
Sorry, I'm not clear. I don't want change my url, now it's good. But I would redirect old url (ie on search engine) on new url .
example: the old url was www.blabla.com/category/products1.html now the new url is www.blabla.com/products1.html
Something like this:
RewriteCond %{HTTP_HOST} ^www.mysample.com
RewriteRule ^subdir/(.*)$ http://www.mysample.com/$1 [L,R=301]
But I don't know how replace subdir with category
@centoasa, so, in the BO => Product page => SEO tab => you want to have like this example http://projet/PrestaShop/ca/32-test
in your "Search Engine Optimization" section?
Thanks!
@khouloudbelguith I'm explain more better. If you see now my website, you note that the url have schema {id}{-:id_product_attribute}-{rewrite}.html (ie https://www.100asa.it/it/2000-zebra-gk-420t-stampante-etichette.html )
However, of course, search engines have still saved the old URLs (in the old standard prestashop format).
Now: I would like customers who click on the old url (in search engines) to be redirected to the new url
old url: https://www.100asa.it/it/stampanti-desktop/2000-zebra-gk-420t-stampante-etichette.html
new url: https://www.100asa.it/it/2000-zebra-gk-420t-stampante-etichette.html
@centoasa, The most difficult thing is to be able to export all your old urls and guess the new url.
You decide to change the URL of all products. The first step is to export the table "ps_products" in order to have all the concerned IDs.
With "ps_product" we have all that is possible to generate old links to the products:
http: //www.mysite/category/22-link_rewrite
http: //www.mysite/category/23-link_rewrite
Who was then redirected to the new url.
http: //www.monsite/22-link_rewrite
http: //www.mysite/23-link_rewrite
You can use RedirectPermanent /http: //www.mysite/category/22-link_rewrite /http: //www.mysite/category/22-link_rewrite
I hope this is help you to solve your issue.
If you need help, you can ask on the Forum (https://www.prestashop.com/forums/), Gitter (https://gitter.im/PrestaShop/General) or Stack Overflow (https://stackoverflow.com/questions/tagged/prestashop).
Thanks for your understanding!
@khouloudbelguith I'm explain more better. If you see now my website, you note that the url have schema {id}{-:id_product_attribute}-{rewrite}.html (ie https://www.100asa.it/it/2000-zebra-gk-420t-stampante-etichette.html )
However, of course, search engines have still saved the old URLs (in the old standard prestashop format).
Now: I would like customers who click on the old url (in search engines) to be redirected to the new url
old url: https://www.100asa.it/it/stampanti-desktop/2000-zebra-gk-420t-stampante-etichette.html
new url: https://www.100asa.it/it/2000-zebra-gk-420t-stampante-etichette.html
Did you manage to solve this issue? I am currently trying to get rid of {categories:/}, but somehow I cannot because of old links. I have the same issue as you did. Do you know the solution for this?