Jump to content

clementbo

Members
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • Activity
    Developer

clementbo's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi everyone, I've made my own module for stores management on my website. I have implemented a solution to allow customers to find stores using countries and cities filter. I can have 3 different urls : the basic one, the one with the country and a last one with the country and the city. I have added new rule on the dispatcher to clean every url and this perfectly works. Nonetheless, I got big issue when I start to change language. For instance, when I just have choosen the country, I have this url : --> www.toto.fr/en/stores/89/italy/genova Then when I switch to french language, I got redirection saying that page moved to : --> toto.fr/fr/magasin/89/italy/genova?categ=stores&id=89&name1=italy&name2=genova whereas I expected having : toto.fr/fr/magasin/89/italie/genova Does anyone have kind of explanations ? Or just an advice on what I should check or try ? Thanks in advance and have nice day ! By the way, this is the rule I use : 'stores_rule' => array( 'controller' => 'stores', 'rule' => '{stores}/{id}/{nom_p}/{nom_v}', 'keywords' => array( 'id' => array('regexp' => '[0-9]+', 'param' => 'id_p'), 'nom_pays' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'name1'), 'stores' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'categ'), 'nom_ville' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'name2') ) )
  2. Bonjour à tous, Je fais face depuis quelques jours à un problème que je ne m'explique pas : J'ai ajouté quelques lignes de code dans le fichier .htaccess afin d'utiliser l'url rewritting, tout fonctionne très bien, mon seul soucis apparait quand je veux changer de langues. En effet, à ce moment la, l'url rewritting n'est plus utilisé, et dans la barre d'adresse apparait l'url physique. Je n'ai aucune idée d'où pourrait provenir ce comportement étrange Merci de votre aide
  3. Mon problème est en fait lié à la gestion des url canoniques. Quand je désactive la redirection vers l'url canonique, je n'ai plus de problème, la barre d'adresse m'indique bien l'url renseignée dans le fichier .htaccess Cependant, je trouve cela plutôt gênant de devoir décoché cette option, quelqu'un aurait-il une idée ? Je pense qu'il doit y avoir une classe ou un controller à surcharger, mais je ne sais pas vraiment où chercher...
  4. Bonjour à tous, Je travaille actuellement sur prestashop 1.4.8.2. Mon objectif est d'utiliser l'url rewritting afin d'avoir un meilleur référencement au niveau des différentes boutiques que nous possédons. Pour cela, j'ai donc ajouté quelques lignes de le fichier .htaccess. A priori, la redirection fonctionne bien mais il y a un petit problème au niveau de la barre d'adresse : en effet, quand je tape l'url monsite.fr/fr/magasins/8/France je suis bien redirigé vers la bonne page mais l'url affiché dans la barre d'adresse est : monsite.fr/fr/magasins?id_pays=8&name_country=France En cherchant sur le net, les seuls cas similaires au miens étaient dus au fait que l'adresse était donné en chemin absolu, ce qui n'est pas mon cas. J'ai noté également un autre comportement étrange, en commentant la ligne : RewriteRule ^fr/magasins$ /stores.php?isolang=fr [QSA,L] qui existe de base, ma règle de réécriture ne fonctionne plus. Voici le contenu de mon fichier .htacces : <IfModule mod_rewrite.c> # URL rewriting module activation RewriteEngine on # URL rewriting rules RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$1$2.jpg [L] RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$1$2$3.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$1$2$3$4.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^c/([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /img/c/$1$2.jpg [L] RewriteRule ^c/([a-zA-Z-]+)/[a-zA-Z0-9-]+\.jpg$ /img/c/$1.jpg [L] RewriteRule ^([a-z]{2})/[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$2&isolang=$1 [QSA,L] RewriteRule ^([a-z]{2})/([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$2&isolang=$1 [QSA,L] RewriteRule ^([a-z]{2})/([0-9]+)\-[a-zA-Z0-9-]*(/[a-zA-Z0-9-]*)+ /category.php?id_category=$2&isolang=$1&noredirect=1 [QSA,L] RewriteRule ^([a-z]{2})/([0-9]+)\-[a-zA-Z0-9-]* /category.php?id_category=$2&isolang=$1 [QSA,L] RewriteRule ^([a-z]{2})/content/([0-9]+)\-[a-zA-Z0-9-]* /cms.php?isolang=$1&id_cms=$2 [QSA,L] RewriteRule ^([a-z]{2})/content/category/([0-9]+)\-[a-zA-Z0-9-]* /cms.php?isolang=$1&id_cms_category=$2 [QSA,L] RewriteRule ^([a-z]{2})/([0-9]+)__[a-zA-Z0-9-]* /supplier.php?isolang=$1&id_supplier=$2 [QSA,L] RewriteRule ^([a-z]{2})/([0-9]+)_[a-zA-Z0-9-]* /manufacturer.php?isolang=$1&id_manufacturer=$2 [QSA,L] RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /img/c/$1$2.jpg [L] RewriteRule ^([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$1 [QSA,L] RewriteRule ^[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$1 [QSA,L] RewriteRule ^([0-9]+)\-[a-zA-Z0-9-]*(/[a-zA-Z0-9-]*)+ /category.php?id_category=$1&noredirect=1 [QSA,L] RewriteRule ^([0-9]+)\-[a-zA-Z0-9-]* /category.php?id_category=$1 [QSA,L] RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*) /supplier.php?id_supplier=$1 [QSA,L] RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*) /manufacturer.php?id_manufacturer=$1 [QSA,L] RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*) /cms.php?id_cms=$1 [QSA,L] RewriteRule ^content/category/([0-9]+)\-([a-zA-Z0-9-]*) /cms.php?id_cms_category=$1 [QSA,L] RewriteRule ^en/address$ /address.php?isolang=en [QSA,L] RewriteRule ^en/addresses$ /addresses.php?isolang=en [QSA,L] RewriteRule ^en/authentication$ /authentication.php?isolang=en [QSA,L] RewriteRule ^en/the-brand$ /brand.php?isolang=en [QSA,L] RewriteRule ^en/cart$ /cart.php?isolang=en [QSA,L] RewriteRule ^en/contact-us$ /contact-form.php?isolang=en [QSA,L] RewriteRule ^en/discount$ /discount.php?isolang=en [QSA,L] RewriteRule ^en/guest-tracking$ /guest-tracking.php?isolang=en [QSA,L] RewriteRule ^en/order-history$ /history.php?isolang=en [QSA,L] RewriteRule ^en/identity$ /identity.php?isolang=en [QSA,L] RewriteRule ^en/my-account$ /my-account.php?isolang=en [QSA,L] RewriteRule ^en/bobbiesorder$ /order.php?isolang=en [QSA,L] RewriteRule ^en/order-follow$ /order-follow.php?isolang=en [QSA,L] RewriteRule ^en/quick-order$ /order-opc.php?isolang=en [QSA,L] RewriteRule ^en/order-slip$ /order-slip.php?isolang=en [QSA,L] RewriteRule ^en/forgot-password$ /password.php?isolang=en [QSA,L] RewriteRule ^en/search$ /search.php?isolang=en [QSA,L] RewriteRule ^en/stores$ /stores.php?isolang=en [QSA,L] RewriteRule ^en$ /en/ [QSA,L] RewriteRule ^en/([^?&]*)$ /$1?isolang=en [QSA,L] RewriteRule ^fr/adresse$ /address.php?isolang=fr [QSA,L] RewriteRule ^fr/adresses$ /addresses.php?isolang=fr [QSA,L] RewriteRule ^fr/authentication$ /authentication.php?isolang=fr [QSA,L] RewriteRule ^fr/la-marque$ /brand.php?isolang=fr [QSA,L] RewriteRule ^fr/panier$ /cart.php?isolang=fr [QSA,L] RewriteRule ^fr/contactez-nous$ /contact-form.php?isolang=fr [QSA,L] RewriteRule ^fr/bons-de-reduction$ /discount.php?isolang=fr [QSA,L] RewriteRule ^fr/suivi-commande-invite$ /guest-tracking.php?isolang=fr [QSA,L] RewriteRule ^fr/historique-des-commandes$ /history.php?isolang=fr [QSA,L] RewriteRule ^fr/identite$ /identity.php?isolang=fr [QSA,L] RewriteRule ^fr/mon-compte$ /my-account.php?isolang=fr [QSA,L] RewriteRule ^fr/bobbiesorder$ /order.php?isolang=fr [QSA,L] RewriteRule ^fr/details-de-la-commande$ /order-follow.php?isolang=fr [QSA,L] RewriteRule ^fr/commande-rapide$ /order-opc.php?isolang=fr [QSA,L] RewriteRule ^fr/avoirs$ /order-slip.php?isolang=fr [QSA,L] RewriteRule ^fr/mot-de-passe-oublie$ /password.php?isolang=fr [QSA,L] RewriteRule ^fr/recherche$ /search.php?isolang=fr [QSA,L] RewriteRule ^fr/magasins/([0-9]+)/(.*)$ /stores.php?isolang=fr&id_pays=$1&name_country=$2 [QSA,L] RewriteRule ^fr/magasins$ /stores.php?isolang=fr [QSA,L] RewriteRule ^fr$ /fr/ [QSA,L] RewriteRule ^fr/([^?&]*)$ /$1?isolang=fr [QSA,L] </IfModule> # Catch 404 errors ErrorDocument 404 /404.php <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/gif "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType text/css "access plus 1 week" ExpiresByType text/javascript "access plus 1 week" ExpiresByType application/javascript "access plus 1 week" ExpiresByType application/x-javascript "access plus 1 week" ExpiresByType image/x-icon "access plus 1 year" </IfModule> FileETag INode MTime Size <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/x-javascript </IfModule> Les lignes concernant les règles posant problèmes se situent quelques lignes au-dessus du "# catch 404 errors". Merci à tous pour votre aide
×
×
  • Create New...