DARKF3D3 Posted January 3, 2011 Share Posted January 3, 2011 Ciao a tutti, ho attivato la funzione URL rewrite sul mio sito, ora i link dei prodotti e delle categorie vengono visualizzati così:CATEGORIAhttp://127.0.0.1:8888/prestashop/10-accessoriPRODOTTOhttp://127.0.0.1:8888/prestashop/5-macbook-air.htmlCome posso togliere i numeri dai link? Vorrei che i link venissero visualizzati in questo modo:http://127.0.0.1:8888/prestashop/macbook-air.htmlQuesto è il codice del file .htaccess # .htaccess automaticaly generated by PrestaShop e-commerce open-source solution # http://www.prestashop.com - http://www.prestashop.com/forums # URL rewriting module activation RewriteEngine on # URL rewriting rules RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /prestashop/img/p/$1-$2$3.jpg [L,E] RewriteRule ^([0-9]+)\-([0-9]+)/([_a-zA-Z0-9-]*)\.jpg$ /prestashop/img/p/$1-$2.jpg [L,E] RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /prestashop/img/c/$1$2.jpg [L,E] RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /prestashop/product.php?id_product=$3&isolang;=$1$5 [L,E] RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /prestashop/product.php?id_product=$2&isolang;=$1$4 [L,E] RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /prestashop/category.php?id_category=$2&isolang;=$1 [QSA,L,E] RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /prestashop/product.php?id_product=$2$4 [L,E] RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /prestashop/product.php?id_product=$1$3 [L,E] RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /prestashop/category.php?id_category=$1 [QSA,L,E] RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /prestashop/cms.php?id_cms=$1 [QSA,L,E] RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /prestashop/supplier.php?id_supplier=$1$3 [QSA,L,E] RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /prestashop/manufacturer.php?id_manufacturer=$1$3 [QSA,L,E] RewriteRule ^lang-([a-z]{2})/(.*)$ /prestashop/$2?isolang=$1 [QSA,L,E] # Catch 404 errors ErrorDocument 404 /prestashop/404.php Link to comment Share on other sites More sharing options...
disarci Posted January 6, 2011 Share Posted January 6, 2011 ciao,il file htaccess,si limita a tradurre proprio i numeri, quindi lavorando così non è possibile.Ho visto delle modifiche al codice per eliminare l'id prodotto (o categoria) ma su vecchie versioni, anche perché non ne vedo l'utilità. http://127.0.0.1:8888/prestashop/5-macbook-air.html RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /prestashop/product.php?id_product=$2$4 [L,E] cioè:se l'indirizzo è composto /qualchecosa/numero-qualchealtracosa.htmlcambialo in: /qualchecosa/product.php?id_product=numero quindi il funzionamento di ricerca nel db è dato proprio dal numero (id prodotto) Link to comment Share on other sites More sharing options...
PizzaPie Posted January 10, 2011 Share Posted January 10, 2011 Scusate se mi inserisco nella discussione, ma avrei una piccola domanda/curiosità:ho notato che l'url generato per la categoria è del tipo: http://nome_server/prestashop/id_categoria-nome_categoriaè possibile aggiungere ".html" in fondo all'url generato? può essere vantaggioso oppure no? 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