Jump to content

Recommended Posts

Bonjour,

Sur mon site, j'ai deux formats d'URL pour les fiches produit :

http://www.site.com/fr/categorie/783-nom-produit-4992152502623.html
et
http://www.site.com/fr/categorie/789-nom-produit.html

Je souhaiterais que tous les produits aient le dernier format d'URL (sans les chiffres à la fin, l'id-product n'étant pas dérangeant)

Je comprends bien que c'est dans le htaccess, mais je n'arrive pas à trouver où.

RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /shop/img/p/$1-$2$3.jpg [L]
RewriteRule ^([0-9]+)\-([0-9]+)/[_a-zA-Z0-9-]*\.jpg$ /shop/img/p/$1-$2.jpg [L]
RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /shop/img/c/$1$2.jpg [L]
RewriteRule ^([0-9]+)\-[a-zA-Z0-9-]*\.html /shop/product.php?id_product=$1 [QSA,L]
RewriteRule ^([0-9]+)\-[a-zA-Z0-9-]* /shop/category.php?id_category=$1 [QSA,L]
RewriteRule ^[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html /shop/product.php?id_product=$1 [QSA,L]
RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*) /shop/supplier.php?id_supplier=$1 [QSA,L]
RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*) /shop/manufacturer.php?id_manufacturer=$1 [QSA,L]
RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*) /shop/cms.php?id_cms=$1 [QSA,L]
RewriteRule ^content/category/([0-9]+)\-([a-zA-Z0-9-]*) /shop/cms.php?id_cms_category=$1 [QSA,L]
RewriteRule ^([a-z]{2})/[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html /shop/product.php?id_product=$2&isolang;=$1 [QSA,L]
RewriteRule ^([a-z]{2})/([0-9]+)\-[a-zA-Z0-9-]*\.html /shop/product.php?id_product=$2&isolang;=$1 [QSA,L]
RewriteRule ^([a-z]{2})/([0-9]+)\-[a-zA-Z0-9-]* /shop/category.php?id_category=$2&isolang;=$1 [QSA,L]

J'ai cherché dans les archives mais sans succès.
Merci beaucoup pour votre aide.

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...