mattheoh Posted July 18, 2011 Share Posted July 18, 2011 Bnjour à tous,J'ai actuellement un site sous prestashop uniquement en français. (La version de PS est la 1.3.2.3)L'URL d'une page produit est du type : http://www.monsite.com/nom-produitJe souhaite mettre en production la langue anglaise.Afin de ne pas perdre le réf de mes pages françaises, je souhaiterais rediriger les URL :http://www.monsite.com/nom-produit vers http://www.monsite.com/lang-fr/nom-produitJ'ai tenté dans mon htaccess de rajouter : RewriteCond %{REQUEST_URI} !^/(lang-fr|lang-en)/$ [NC] RewriteCond %{REQUEST_URI} !^/(lang-fr|lang-en)$ [NC] RewriteRule ^(.*)$ http://www.monsite.com/lang-fr/$1 [QSA,L,R=301] mais malheureuesment ça ne fonctionne pas...et pire que tout si je change monsite.com par google .com.... ça marche !je ne sais pas trop si c'est cette ligne qui est mal écrite ou une autre qui met le bazar.voici l'entiereté de mon htaccess au cas où : # URL rewriting module activation RewriteEngine on #RewriteCond %{HTTP_HOST} !^www.monsite.com/lang-fr/$ #RewriteRule ^lang-fr/(.*) http://www.monsite.com/$1 [QSA,L,R=301] RewriteCond %{HTTP_HOST} !^www.monsite.com$ RewriteRule ^(.*) http://www.monsite.com/$1 [QSA,L,R=301] #RewriteCond %{REQUEST_URI} !^/(lang-fr|lang-en)/$ [NC] #RewriteCond %{REQUEST_URI} !^/(lang-fr|lang-en)$ [NC] #RewriteRule ^(.*)$ http://www.monsite.com/lang-fr/$1 [QSA,L,R=301] # URL rewriting rules RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2$3.jpg [L,E] RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/c/$1$2.jpg [L,E] RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$3&isolang;=$1$5 [L,E] RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$1$3 [L,E] RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2&isolang;=$1$4 [L,E] RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2$4 [L,E] RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$2&isolang;=$1 [QSA,L,E] RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$1 [QSA,L,E] RewriteRule ^lang-([a-z]{2})/content/([0-9]+)\-([a-zA-Z0-9-]*)$ /cms.php?id_cms=$2&isolang;=$1 [QSA,L,E] RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /cms.php?id_cms=$1 [QSA,L,E] RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /supplier.php?id_supplier=$1$3 [QSA,L,E] RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /manufacturer.php?id_manufacturer=$1$3 [QSA,L,E] RewriteRule ^lang-([a-z]{2})/(.*)$ /$2?isolang=$1 [QSA,L,E] RewriteRule ^$ /index.php [QSA,L,R=301] # Catch 404 errors ErrorDocument 404 /404.php Merci par avance de votre aide... Link to comment Share on other sites More sharing options...
Samy_R Posted July 20, 2011 Share Posted July 20, 2011 Et en utilisant des url type /fr/X-nomproduit ? Link to comment Share on other sites More sharing options...
shaka Posted June 11, 2013 Share Posted June 11, 2013 Bonjour, Quelqu'un a une réponse à ce souci ( y compris sous PS1.5 ? Deux petites lignes de codes dans le Htaccess, ça doit se trouver avec 500 000 membres dans la communauté. Quelqu'un pour valider ces deux lignes : #RewriteCond %{HTTP_HOST} !^www.monsite.com/maboutique/lang-fr/$ #RewriteRule ^lang-fr/(.*) http://www.monsite.com//maboutique/$1 [QSA,L,R=301] Link to comment Share on other sites More sharing options...
l'indien Posted June 5, 2014 Share Posted June 5, 2014 Bonjour, J'ai exactement le même problème, je cherche depuis deux, semaines mais on dirait qu'il y a un secret a conserver sur ce problème et que personne ne veux le dévoiler.... Lol Je cherche donc toujours ! Link to comment Share on other sites More sharing options...
louf Posted April 13, 2018 Share Posted April 13, 2018 Bonjour à tous, Moi c'est le problème inverse ma rubrique ajout de produit est en anglais et je voudrais la mettre en français. et je ne sais pas comment faire . En plus tous le reste (back office) est en français sauf l'ajout de produit merci de m 'aider Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now