差别
这里会显示出您选择的修订版和当前版本之间的差别。
— |
amh4.2:nginx_rewrite_rule:prestashop [2017/05/26 16:01] (当前版本) root 创建 |
||
---|---|---|---|
行 1: | 行 1: | ||
+ | ===prestashop 1.3在nginx下的伪静态规则=== | ||
+ | \\ | ||
+ | <code> | ||
+ | location / { | ||
+ | rewrite "^/lang-([a-z]{2})/([a-zA-Z0-9-]*)/([a-zA-Z0-9-]*)-([0-9]+).html(.*)$" /product.php?id_product=$4&isolang=$1$5 last; | ||
+ | rewrite "^/lang-([a-z]{2})/([a-zA-Z0-9-]*)-([0-9]+).html(.*)$" /product.php?id_product=$3&isolang=$1$4 last; | ||
+ | rewrite "^/lang-([a-z]{2})/([a-zA-Z0-9-]*)-([0-9]+)(.*)$" /category.php?id_category=$3&isolang=$1 last; | ||
+ | rewrite ^/([a-zA-Z0-9-]*)/([a-zA-Z0-9-]*)-([0-9]+).html(.*)$ /product.php?id_product=$3$4 last; | ||
+ | rewrite ^/([a-zA-Z0-9-]*)-([0-9]+).html(.*)$ /product.php?id_product=$2$3 last; | ||
+ | rewrite ^/([a-zA-Z0-9-]*)-([0-9]+)(.*)$ /category.php?id_category=$2 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; | ||
+ | } | ||
+ | location ~ .*\.jpg$ { | ||
+ | expires 30d; | ||
+ | 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; | ||
+ | } | ||
+ | </code> |
最后更改: in 2017/05/26 16:01