typiac Posted October 20, 2011 Share Posted October 20, 2011 Voici mon problème: J'ai un module en footer qui appelle les liens CMS codé comme suit: <ul> <li><a href="contact-form.php">{l s='Contact' mod='tmfooterlinks'}</a></li> <li><a href="cms.php?id_cms=1">{l s='Delivery' mod='tmfooterlinks'}</a></li> <li><a href="cms.php?id_cms=2">{l s='Legal Notice' mod='tmfooterlinks'}</a></li> <li><a href="cms.php?id_cms=3">{l s='Terms and conditions' mod='tmfooterlinks'}</a></li> <li><a href="cms.php?id_cms=4">{l s='About us' mod='tmfooterlinks'}</a></li> </ul> J'ai ensuite activé le re-writing automatique dans la BO. Mon fichier access se présente comme ceci: SetEnv PHP_VER 5 SetEnv REGISTER_GLOBALS 0 # .htaccess automaticaly generated by PrestaShop e-commerce open-source solution # WARNING: PLEASE DO NOT MODIFY THIS FILE MANUALLY. IF NECESSARY, ADD YOUR SPECIFIC CONFIGURATION WITH THE HTACCESS GENERATOR IN BACK OFFICE # http://www.prestashop.com - http://www.prestashop.com/forums <IfModule mod_rewrite.c> # URL rewriting module activation RewriteEngine on # URL rewriting rules RewriteRule ^api/?(.*)$ /webservice/dispatcher.php?url=$1 [QSA,L] RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1-$2$3.jpg [L] RewriteRule ^([0-9]+)\-([0-9]+)/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1-$2.jpg [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 ^([0-9]+)\-[a-zA-Z0-9-]* /category.php?id_category=$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-]*) /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$2$3$4 [QSA,L] RewriteRule ^content/category/([0-9]+)\-([a-zA-Z0-9-]*) /cms.php?id_cms_category=$1 [QSA,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-]* /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 ^en/page-not-found$ /404.php?isolang=en [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/best-sales$ /best-sales.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/manufacturers$ /manufacturer.php?isolang=en [QSA,L] RewriteRule ^en/my-account$ /my-account.php?isolang=en [QSA,L] RewriteRule ^en/new-products$ /new-products.php?isolang=en [QSA,L] RewriteRule ^en/order$ /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/password-recovery$ /password.php?isolang=en [QSA,L] RewriteRule ^en/prices-drop$ /prices-drop.php?isolang=en [QSA,L] RewriteRule ^en/search$ /search.php?isolang=en [QSA,L] RewriteRule ^en/sitemap$ /sitemap.php?isolang=en [QSA,L] RewriteRule ^en/stores$ /stores.php?isolang=en [QSA,L] RewriteRule ^en/supplier$ /supplier.php?isolang=en [QSA,L] RewriteRule ^en/([^?&]*) /$1?isolang=en [QSA,L] RewriteRule ^fr/page-non-trouvee$ /404.php?isolang=fr [QSA,L] RewriteRule ^fr/adresse$ /address.php?isolang=fr [QSA,L] RewriteRule ^fr/adresses$ /addresses.php?isolang=fr [QSA,L] RewriteRule ^fr/authentification$ /authentication.php?isolang=fr [QSA,L] RewriteRule ^fr/meilleures-ventes$ /best-sales.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/fabricants$ /manufacturer.php?isolang=fr [QSA,L] RewriteRule ^fr/mon-compte$ /my-account.php?isolang=fr [QSA,L] RewriteRule ^fr/nouveaux-produits$ /new-products.php?isolang=fr [QSA,L] RewriteRule ^fr/commande$ /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/promotions$ /prices-drop.php?isolang=fr [QSA,L] RewriteRule ^fr/recherche$ /search.php?isolang=fr [QSA,L] RewriteRule ^fr/plan-du-site$ /sitemap.php?isolang=fr [QSA,L] RewriteRule ^fr/magasins$ /stores.php?isolang=fr [QSA,L] RewriteRule ^fr/fournisseurs$ /supplier.php?isolang=fr [QSA,L] RewriteRule ^fr/([^?&]*) /$1?isolang=fr [QSA,L] RewriteRule ^es/pagina-no-encuentra$ /404.php?isolang=es [QSA,L] RewriteRule ^es/direccion$ /address.php?isolang=es [QSA,L] RewriteRule ^es/direcciones$ /addresses.php?isolang=es [QSA,L] RewriteRule ^es/autenticacion$ /authentication.php?isolang=es [QSA,L] RewriteRule ^es/mas-vendidos$ /best-sales.php?isolang=es [QSA,L] RewriteRule ^es/carro-de-la-compra$ /cart.php?isolang=es [QSA,L] RewriteRule ^es/contactenos$ /contact-form.php?isolang=es [QSA,L] RewriteRule ^es/descuento$ /discount.php?isolang=es [QSA,L] RewriteRule ^es/estado-pedido$ /guest-tracking.php?isolang=es [QSA,L] RewriteRule ^es/historial-de-pedidos$ /history.php?isolang=es [QSA,L] RewriteRule ^es/identidad$ /identity.php?isolang=es [QSA,L] RewriteRule ^es/fabricantes$ /manufacturer.php?isolang=es [QSA,L] RewriteRule ^es/mi-cuenta$ /my-account.php?isolang=es [QSA,L] RewriteRule ^es/nuevos-productos$ /new-products.php?isolang=es [QSA,L] RewriteRule ^es/carrito$ /order.php?isolang=es [QSA,L] RewriteRule ^es/devolucion-de-productos$ /order-follow.php?isolang=es [QSA,L] RewriteRule ^es/pedido-rapido$ /order-opc.php?isolang=es [QSA,L] RewriteRule ^es/vales$ /order-slip.php?isolang=es [QSA,L] RewriteRule ^es/contrasena-olvidado$ /password.php?isolang=es [QSA,L] RewriteRule ^es/promocion$ /prices-drop.php?isolang=es [QSA,L] RewriteRule ^es/buscar$ /search.php?isolang=es [QSA,L] RewriteRule ^es/mapa-del-sitio$ /sitemap.php?isolang=es [QSA,L] RewriteRule ^es/tiendas$ /stores.php?isolang=es [QSA,L] RewriteRule ^es/proveedores$ /supplier.php?isolang=es [QSA,L] RewriteRule ^es/([^?&]*) /$1?isolang=es [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> Voilà, donc maintenant, lorsque je clic sur le 1er lien CMS (par exemple "à propos"), ça fonctionne. Mais ensuite, si je clic sur le CMS?2, et bien ça ne fonctionne plus....à moins que je repasse par l'index du site à chaque fois.... Comment faire pour ne pas avoir à repasser par l'index pour que les liens fonctionnent? Link to comment Share on other sites More sharing options...
Ether Création Posted October 20, 2011 Share Posted October 20, 2011 Bonjour, Il faut mettre l'url du site/le nom réecrit Cordialement, Arthur Link to comment Share on other sites More sharing options...
typiac Posted October 21, 2011 Author Share Posted October 21, 2011 D'accord. Dans mon cas, il s'agit des pages suivantes qui me posent problème: RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*) /cms.php?id_cms=$1$2$3$4 [QSA,L] RewriteRule ^content/category/([0-9]+)\-([a-zA-Z0-9-]*) /cms.php?id_cms_category=$1 [QSA,L] J'ai rajouté "$2$3$4" pour tester si ça fonctionne puisque j'ai ces 4 ID de CMS (comme un peu tout le monde je pense...) J'ai aussi testé: RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*) /cms.php?id_cms=$1 [QSA,L] RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*) /cms.php?id_cms=$2 [QSA,L] RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*) /cms.php?id_cms=$3 [QSA,L] RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*) /cms.php?id_cms=$4 [QSA,L] RewriteRule ^content/category/([0-9]+)\-([a-zA-Z0-9-]*) /cms.php?id_cms_category=$1 [QSA,L] Mais le résultat est le même: cela ne fonctionne que dans la mesure où je repasse par la page d'accueil! Du coup, je me dis que j'ai peut-être mal compris ton message Ether Création! Link to comment Share on other sites More sharing options...
typiac Posted October 25, 2011 Author Share Posted October 25, 2011 Franchement, j'arrête pas d'essayer des trucs différents et ça ne marche pas... Help!!!! Link to comment Share on other sites More sharing options...
typiac Posted November 2, 2011 Author Share Posted November 2, 2011 Je ne sais pas si c'est lié, mais j'ai également le même type de problème avec les traductions: Si j'invoque, la langue anglaise sur une page produit, elle ne fonctionne pas et la page reste en français. En revanche, si je repasse par l'accueil et que j'invoque la traduction, là tout refonctionne! Ca serait cool si quelqu'un pouvait au moins me donner une piste pour mes recherches car je débute sur PS et j'avoue être perdu... Link to comment Share on other sites More sharing options...
justincarton Posted December 2, 2011 Share Posted December 2, 2011 J'ai exactement le même problème... Voici le lien de mon post au cas où : http://www.prestashop.com/forums/topic/144679-probleme-url-rewriting-sur-liens-cms-du-footer/ 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