FAQ

Page Discussion History

Difference between revisions of "Prestashop Rewrites"

(Created page with "Below is just a snippet of a collection of rewrite rules so clean URL's can be obtained in Prestshop. <geshi lang="nginx"> rewrite ^/([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/(...")
 
m (Put double quotes around the regexp only, not around the entire rewrite)
 
Line 1: Line 1:
Below is just a snippet of a collection of rewrite rules so clean URL's can be obtained in Prestshop.
+
Below is just a snippet of a collection of rewrite rules so clean URL's can be obtained in Prestashop.
  
 
<geshi lang="nginx">
 
<geshi lang="nginx">
Line 5: Line 5:
 
rewrite ^/([0-9]+)\-([0-9]+)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2.jpg last;
 
rewrite ^/([0-9]+)\-([0-9]+)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2.jpg last;
 
rewrite ^/([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/c/$1$2.jpg last;
 
rewrite ^/([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/c/$1$2.jpg last;
rewrite "^/lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$3&isolang;=$1$5" last;
+
rewrite "^/lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$" /product.php?id_product=$3&isolang=$1$5 last;
rewrite "^/lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2&isolang;=$1$4" last;
+
rewrite "^/lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$" /product.php?id_product=$2&isolang=$1$4 last;
rewrite "^/lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$2&isolang;=$1" last;
+
rewrite "^/lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$" /category.php?id_category=$2&isolang=$1 last;
 
rewrite ^/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2$4 last;
 
rewrite ^/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2$4 last;
 
rewrite ^/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$1$3 last;
 
rewrite ^/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$1$3 last;
Line 14: Line 14:
 
rewrite ^/([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /supplier.php?id_supplier=$1$3 last;
 
rewrite ^/([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /supplier.php?id_supplier=$1$3 last;
 
rewrite ^/([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /manufacturer.php?id_manufacturer=$1$3 last;
 
rewrite ^/([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /manufacturer.php?id_manufacturer=$1$3 last;
rewrite "^/lang-([a-z]{2})/(.*)$ /$2?isolang=$1" last;
+
rewrite "^/lang-([a-z]{2})/(.*)$" /$2?isolang=$1 last;
 
</geshi>
 
</geshi>

Latest revision as of 12:45, 18 January 2013

Below is just a snippet of a collection of rewrite rules so clean URL's can be obtained in Prestashop.

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